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