shithub: MicroHs

ref: 6ad90611a215686eab37fd3bbd970398dfa7bbb3
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