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