diff --git a/kyo-data/shared/src/main/scala/kyo/Instant.scala b/kyo-data/shared/src/main/scala/kyo/Instant.scala index e7434aae4..63c7f7e77 100644 --- a/kyo-data/shared/src/main/scala/kyo/Instant.scala +++ b/kyo-data/shared/src/main/scala/kyo/Instant.scala @@ -145,7 +145,7 @@ object Instant: * @return * The earlier of the two Instants. */ - def min(other: Instant): Instant = if instant.isBefore(other) then instant else other + infix def min(other: Instant): Instant = if instant.isBefore(other) then instant else other /** Returns the maximum of this Instant and another. * @@ -154,7 +154,7 @@ object Instant: * @return * The later of the two Instants. */ - def max(other: Instant): Instant = if instant.isAfter(other) then instant else other + infix def max(other: Instant): Instant = if instant.isAfter(other) then instant else other /** Converts this Instant to a human-readable ISO-8601 formatted string. * diff --git a/kyo-data/shared/src/main/scala/kyo/Schedule.scala b/kyo-data/shared/src/main/scala/kyo/Schedule.scala index 5deb2e7df..cd13742d7 100644 --- a/kyo-data/shared/src/main/scala/kyo/Schedule.scala +++ b/kyo-data/shared/src/main/scala/kyo/Schedule.scala @@ -25,7 +25,7 @@ sealed abstract class Schedule derives CanEqual: * @return * a new schedule that produces the maximum delay of both schedules */ - final def max(that: Schedule): Schedule = + final infix def max(that: Schedule): Schedule = this match case Never => this case Done | Immediate => that @@ -42,7 +42,7 @@ sealed abstract class Schedule derives CanEqual: * @return * a new schedule that produces the minimum delay of both schedules */ - final def min(that: Schedule): Schedule = + final infix def min(that: Schedule): Schedule = this match case Never => that case Done | Immediate => this @@ -293,11 +293,11 @@ object Schedule: final case class Min(a: Schedule, b: Schedule) extends Schedule: def next = a.next match - case Maybe.Empty => b.next - case n @ Maybe.Defined((d1, s1)) => + case Absent => b.next + case n @ Present((d1, s1)) => b.next match - case Maybe.Empty => n - case Maybe.Defined((d2, s2)) => + case Absent => n + case Present((d2, s2)) => Maybe((d1.min(d2), s1.min(s2))) def show = s"(${a.show}).min(${b.show})" end Min