shithub: MicroHs

ref: 660cf9275b8374f89c8f5db51a070070f28c1afc
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