shithub: MicroHs

ref: 9a1bca556796f44f573e7c4b31168e6c54f0e04e
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