shithub: MicroHs

ref: 20d03699a8ffc93e8c8196fe68f8ff08b58eca0d
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