shithub: MicroHs

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