shithub: MicroHs

ref: 46c6609b59a7c1139612e88ba33dd98314f73f77
dir: /Tools/Count.hs/

View raw version
import System.Environment
import Data.List

main = do
  [pat, fn] <- getArgs
  file <- readFile fn
  let n = length $ filter (isPrefixOf pat) (tails file)
  print n