From a794dd98a1554e62be9290c5ccff6430b7e9e3bc Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Wed, 11 Dec 2024 12:14:36 +0000 Subject: [PATCH] Gone point-free --- advent11/Main.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 -- 2.34.1