shithub: MicroHs

ref: 3bb170f2603490d6c7e05f8656880d08cd436edd
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