From 20af31beda7c334a29a3a97bd8d9048ff6a8a54a Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Thu, 5 Dec 2024 07:21:55 -0500 Subject: [PATCH] style: indent case branches --- src/Day4/Part1.idr | 4 ++-- src/Day4/Part2.idr | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Day4/Part1.idr b/src/Day4/Part1.idr index eb9809a..73a5b10 100644 --- a/src/Day4/Part1.idr +++ b/src/Day4/Part1.idr @@ -63,7 +63,7 @@ checkString board str = go (unpack str) go [] _ _ = True go (c :: cs) pos dir = let Just next = moveDir dir pos - | Nothing => False + | Nothing => False in index next board == c && go cs next dir @@ -88,5 +88,5 @@ export solution : String -> Maybe Nat solution inp = let Just (_ ** _ ** board) = parseInput inp - | Nothing => Nothing + | Nothing => Nothing in Just $ countString board "XMAS" diff --git a/src/Day4/Part2.idr b/src/Day4/Part2.idr index 630bb78..b8fd9a8 100644 --- a/src/Day4/Part2.idr +++ b/src/Day4/Part2.idr @@ -14,7 +14,7 @@ checkMS board pos = let Just [ul, ur, dl, dr] = map (map (`index` board)) $ traverse {t=Vect _} (`moveDir` pos) [UL, UR, DL, DR] - | Nothing => False + | Nothing => False in ((ul == 'M' && dr == 'S') || (ul == 'S' && dr == 'M')) && ((ur == 'M' && dl == 'S') || (ur == 'S' && dl == 'M')) @@ -27,5 +27,5 @@ export solution : String -> Maybe Nat solution inp = let Just (_ ** _ ** board) = parseInput inp - | Nothing => Nothing + | Nothing => Nothing in Just $ countMAS board