diff options
| author | Andreas Grois <andi@grois.info> | 2023-12-01 23:21:14 +0100 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2023-12-01 23:30:43 +0100 |
| commit | 24d7fab85b2eb1b7996fd0ceccdd0377f1ce087b (patch) | |
| tree | 2295b86307d2e5e6fbb59f009d84a635d74ef096 /Common/DayPart.lean | |
Day 1
Diffstat (limited to 'Common/DayPart.lean')
| -rw-r--r-- | Common/DayPart.lean | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Common/DayPart.lean b/Common/DayPart.lean new file mode 100644 index 0000000..c6a4d44 --- /dev/null +++ b/Common/DayPart.lean @@ -0,0 +1,12 @@ +namespace DayPart + +abbrev Days := {d : Nat // d > 0 ∧ d <= 25} +inductive Parts +| One +| Two + +class Parse (day : Days) {ι : outParam Type} where + parse : String → Option ι + +class Part (day : Days) (part : Parts) {ι ρ : outParam Type} [Parse day (ι := ι)] [ToString ρ] where + run : ι → Option ρ -- can fail, because it deals with user input... |
