shithub: MicroHs

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