shithub: MicroHs

ref: 30ed73a98df14cb18296e7d2178227e6392a8ff7
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