diff options
| author | Andreas Grois <andi@grois.info> | 2024-11-22 22:10:48 +0100 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2024-11-22 22:10:48 +0100 |
| commit | ce7214e07a766bc1e5ab02346e42eb6ca441c509 (patch) | |
| tree | 5bf9378891e3ed6478757770b71d6008a452bf63 /Day5.lean | |
| parent | e9f48c21f878f727778e17294217c2094a595e5d (diff) | |
Fix deprecation warnings for Lean 4.13
Diffstat (limited to 'Day5.lean')
| -rw-r--r-- | Day5.lean | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -180,7 +180,7 @@ def part1 (input : ((List Seed) × Almanach)) : Option Nat := ∘ a.soilToFertilizer.apply ∘ a.seedsToSoil.apply let locations := input.fst.map seedToLocation - NatId.toNat <$> locations.minimum? + NatId.toNat <$> locations.min? -- Part 2 seems unmanageable by brute force. @@ -271,7 +271,7 @@ private def part1_2 (input : ((List Seed) × Almanach)) : Option Nat := let seedsToLocation := seedsToHumidity.combine (Mappings2.fromMappings a.humidityToLocation) let seedToLocation := seedsToLocation.apply let locations := input.fst.map seedToLocation - NatId.toNat <$> locations.minimum? + NatId.toNat <$> locations.min? private structure SeedRange where start : Seed @@ -315,7 +315,7 @@ def part2 (input : ((List Seed) × Almanach)) : Option Nat := let potentialSeeds := seedToLocation.mappings.filterMap λ m ↦ (SeedRange.findSmallestSeedAbove seedRanges m.start) -- could filter by range end, but who cares? let locations := potentialSeeds.map seedToLocation.apply - NatId.toNat <$> locations.minimum? + NatId.toNat <$> locations.min? open DayPart instance : Parse ⟨5, by simp⟩ (ι := (List Seed) × Almanach) where |
