shithub: MicroHs

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