shithub: MicroHs

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