shithub: MicroHs

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