shithub: MicroHs

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