shithub: MicroHs

ref: 638e7ca702c9c27bd58a72d68b0862c86e68c25b
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