shithub: MicroHs

ref: 98209f4e8272dd76d721b4cecc744f788c3c78b9
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