shithub: MicroHs

ref: 1cf6dce4c28d3020699d04d8c2b98280c298e109
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