shithub: MicroHs

ref: e2eb643f79f482babd16f8ad91c6a0074f4c845b
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