shithub: MicroHs

ref: 2dc297eb6a2d48cf1e8baae60e3f9edfc54a340a
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