shithub: MicroHs

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