Created
June 21, 2017 08:33
-
-
Save anonymous/a416bad03ac5ddbfcbe5c8812c9a7467 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
-- L'exercice est de passer le fichier qui se trouve ici | |
-- https://vote.gnome.org/blt.php?election_id=25 | |
-- et d'en extraire les informations | |
woBoundaries = | |
let r = reverse . drop 1 | |
in r . r | |
main = do | |
content <- getContents | |
let entries = drop 1 $ lines content | |
let votes = | |
map (woBoundaries . words) | |
$ takeWhile (/= "0") entries | |
let candidates = | |
map woBoundaries | |
$ drop 1 | |
$ dropWhile (/= "0") entries | |
print candidates | |
print votes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment