shithub: MicroHs

ref: 92bdf127ca8813f47e8e6d9ad1f9990e40fb8c39
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