ref: a6b9843082a80abae9595f5c805d88509c3c1b1a dir: /Tools/Count.hs/
import System.Environment import Data.List main = do [pat, fn] <- getArgs file <- readFile fn let n = length $ filter (isPrefixOf pat) (tails file) print n