shithub: MicroHs

ref: 6f5ab727dd256c4cfb5fac3976d3a6cb1a82f53b
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