shithub: MicroHs

ref: 30bbf972cec6f7ed080b42d6ccead04e110f8b98
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