shithub: MicroHs

ref: 933e45935e3626dbf09d8f0b8ba7fd261fc40fed
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