Skip to content

Instantly share code, notes, and snippets.

Created June 21, 2017 08:33
Show Gist options
  • Save anonymous/a416bad03ac5ddbfcbe5c8812c9a7467 to your computer and use it in GitHub Desktop.
Save anonymous/a416bad03ac5ddbfcbe5c8812c9a7467 to your computer and use it in GitHub Desktop.
-- 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