shithub: MicroHs

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