shithub: MicroHs

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