shithub: MicroHs

ref: 42b6317a3cc34a4535db470cc9f687854eb4cf3c
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