shithub: MicroHs

ref: 977b959064ac1d5d3ceba5ad7a32e29bb46bfc0c
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