shithub: MicroHs

ref: 1992c9c6d3b16b6abc4d8a2ec2f32dade98b8c70
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