shithub: MicroHs

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