shithub: MicroHs

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