shithub: MicroHs

ref: a855d4546080dfe88c5d24cce7a3b9b2e741fcda
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