shithub: MicroHs

ref: 124983010cf4ad9c91f5df2a871ceb8ed9dad468
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