From 25efc19b3182c21369436a05dde947b14637a791 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Mon, 8 Dec 2025 22:42:57 +0000 Subject: [PATCH] Format --- haskell/Puzzles/Day8.hs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/haskell/Puzzles/Day8.hs b/haskell/Puzzles/Day8.hs index 5197a50..89af924 100644 --- a/haskell/Puzzles/Day8.hs +++ b/haskell/Puzzles/Day8.hs @@ -13,20 +13,22 @@ puzzle = { number = 8 , parser = \isRealData -> (if isRealData then 1000 else 10,) <$> (V3 <$> decimal <* single ',' <*> decimal <* single ',' <*> decimal) `sepEndBy` newline , parts = - [ uncurry \n -> TL.show - . product - . take 3 - . sortOn Down - . map length - . DS.toLists - . snd - . (!! n) - . connectBoxes - , uncurry . const $ TL.show - . maybe (error "sets never unified") (\((V3 x1 _ _, V3 x2 _ _), _) -> x1 * x2) - . lastMay - . takeWhile ((> 1) . DS.sets . snd) - . connectBoxes + [ uncurry \n -> + TL.show + . product + . take 3 + . sortOn Down + . map length + . DS.toLists + . snd + . (!! n) + . connectBoxes + , uncurry . const $ + TL.show + . maybe (error "sets never unified") (\((V3 x1 _ _, V3 x2 _ _), _) -> x1 * x2) + . lastMay + . takeWhile ((> 1) . DS.sets . snd) + . connectBoxes ] , extraTests = mempty }