ref: 8f1cae8431f8dd21bb981650c7c3f95d208cc5f8 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