ref: 3c66e2e0b6a14e3a76175c9d930b31f0c99d61b1 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