shithub: MicroHs

ref: 60f254d458cd418ade6d34e173007e7c4e3f7aad
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