shithub: MicroHs

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