From: Neil Smith Date: Wed, 11 Dec 2024 12:14:36 +0000 (+0000) Subject: Gone point-free X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=a794dd98a1554e62be9290c5ccff6430b7e9e3bc;p=advent-of-code-24.git Gone point-free --- diff --git a/advent11/Main.hs b/advent11/Main.hs index e6c72f6..835b0e6 100644 --- a/advent11/Main.hs +++ b/advent11/Main.hs @@ -20,9 +20,11 @@ main = print $ part2 stones part1, part2 :: [Int] -> Int -part1 stones = length $ (!! 25) $ iterate blink stones -part2 stonesList = MS.size $ (!! 75) $ iterate blinkMS stones - where stones = MS.fromList stonesList +-- part1 stones = length $ (!! 25) $ iterate blink stones +-- part2 stonesList = MS.size $ (!! 75) $ iterate blinkMS stones +-- where stones = MS.fromList stonesList +part1 = length . (!! 25) . iterate blink +part2 = MS.size . (!! 75) . iterate blinkMS . MS.fromList blink :: [Int] -> [Int] blink = concatMap expandStone