ref: 5c7e2c98eff2e20b93545eb85ebc900588e3d75a 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