From: Neil Smith Date: Sun, 1 Dec 2019 13:15:59 +0000 (+0000) Subject: Part 2 now point-free X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=7a7c6df04a4d7088c08e0b6bebdcf311c492036a;p=advent-of-code-19.git Part 2 now point-free --- diff --git a/advent01/src/advent01.hs b/advent01/src/advent01.hs index 5c70f59..014fbb2 100644 --- 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