shithub: MicroHs

ref: 655e90802b055f1c030bdf19c7ca3fa9e2f9cf3b
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