shithub: MicroHs

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