ref: 3986db6a0d4960e2ca8102a8d0dd9ea59d9592a0 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