shithub: MicroHs

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