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