shithub: MicroHs

ref: 233e0d26c38a2469b4231235ab3bf022b2b3cef8
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