Skip to content

Instantly share code, notes, and snippets.

@ludflu
Last active September 18, 2015 01:28
Show Gist options
  • Save ludflu/41a9276fb54e196ac57f to your computer and use it in GitHub Desktop.
Save ludflu/41a9276fb54e196ac57f to your computer and use it in GitHub Desktop.
import System.Environment
contains :: String -> Int
contains s = if (elem 'e' s) then 1 else 0
main = do
args <- getArgs
content <- readFile (args !! 0)
let ws = concatMap words $ lines content
matchCount = map contains ws in
print $ sum matchCount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment