ref: ac7f6ceeaa737ca72c0a414d0709e84b86ef06c2 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