shithub: MicroHs

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