ref: 1b9bdf04bb2f42b0dda89ecbbdd1c84fa21166f9 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