projects
/
advent-of-code-19.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d3d966
)
Part 2 now point-free
author
Neil Smith
<neil.git@njae.me.uk>
Sun, 1 Dec 2019 13:15:59 +0000
(13:15 +0000)
committer
Neil Smith
<neil.git@njae.me.uk>
Sun, 1 Dec 2019 13:15:59 +0000
(13:15 +0000)
advent01/src/advent01.hs
patch
|
blob
|
history
diff --git
a/advent01/src/advent01.hs
b/advent01/src/advent01.hs
index 5c70f596c4e4d92062f30a2bee20778abbe51e39..014fbb26f8093bf24c87fbce6990715bfabc0904 100644
(file)
--- a/
advent01/src/advent01.hs
+++ b/
advent01/src/advent01.hs
@@
-28,7
+28,7
@@
fuelRequired :: Int -> Int
fuelRequired m = (m `div` 3) - 2
fuelForFuel :: Int -> Int
-fuelForFuel
m = sum $ takeWhile (> 0) $ drop 1 $ iterate fuelRequired m
+fuelForFuel
= sum . takeWhile (> 0) . drop 1 . iterate fuelRequired
-- Parse the input file