shithub: MicroHs

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