summaryrefslogtreecommitdiff
path: root/Day2.lean
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2023-12-07 20:26:51 +0100
committerAndreas Grois <andi@grois.info>2023-12-07 20:26:51 +0100
commit8d6efb1c1fdddc1fbad167510ce25e56be684130 (patch)
treef35cf0d4943ccb397f3d0a91ad8a1cb1116eccdd /Day2.lean
parent9fb83b22220c825943549bc97bdab457bfad7f5b (diff)
Allow error messages in parsing (for debugging)
And fix an off-by-one in day 5
Diffstat (limited to 'Day2.lean')
-rw-r--r--Day2.lean2
1 files changed, 1 insertions, 1 deletions
diff --git a/Day2.lean b/Day2.lean
index 7208a3d..7ed10aa 100644
--- a/Day2.lean
+++ b/Day2.lean
@@ -78,7 +78,7 @@ def part2 (games : List Game) : Nat :=
open DayPart
instance : Parse ⟨2, by simp⟩ (ι := List Game) where
- parse := parse
+ parse := (λ o ↦ match o with | some a => pure a | none => throw "Failed to parse input") ∘ parse
instance : Part ⟨2,_⟩ Parts.One (ι := List Game) (ρ := Nat) where
run := some ∘ part1