shithub: MicroHs

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