Last active
September 18, 2015 01:28
-
-
Save ludflu/41a9276fb54e196ac57f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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