shithub: MicroHs

ref: 1c9763a53ce092c43b435aa4fce3050caf3ae508
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