shithub: MicroHs

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