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