Skip to content

Commit

Permalink
Further progress on generalizing generalizations
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Feb 2, 2025
1 parent d0b5230 commit abf032c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/anticipation+aviation-core.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package instantApi:
type Source = Long
type Result = Long
type Domain = Instants
export Timing.Instant.generic.{generalization, specialization}
export Timing.Instant.generic.{generalization, apply}

package durationApi:
given aviationDuration: Timing.Duration is GenericDuration & SpecificDuration =
Expand Down
2 changes: 1 addition & 1 deletion src/core/aviation.LocalTime.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import java.time as jt

object LocalTime:
given generic: RomanCalendar => LocalTime is Abstractable across Instants into Long =
_.instant.abstraction
_.instant.generic

case class LocalTime(date: Date, time: Clockface, timezone: Timezone):
def instant(using RomanCalendar): Instant =
Expand Down
6 changes: 3 additions & 3 deletions src/core/aviation.Timing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ object Timing:
type Source = Long
type Result = Long
type Domain = Instants
def specialization(long: Long): Timing.TaiInstant = long
def apply(long: Long): Timing.TaiInstant = long
def generalization(instant: Timing.TaiInstant): Long = instant


object Instant:
def apply[InstantType: Abstractable across Instants into Long](instant: InstantType): Instant =
of(instant.abstraction)
of(instant.generic)

erased given underlying: Underlying[Instant, Long] = ###
def of(millis: Long): Instant = millis
Expand All @@ -58,7 +58,7 @@ object Timing:
type Result = Long
type Source = Long
type Domain = Instants
def specialization(long: Long): Timing.Instant = long
def apply(long: Long): Timing.Instant = long
def generalization(instant: Timing.Instant): Long = instant

inline given orderable: Instant is Orderable:
Expand Down

0 comments on commit abf032c

Please sign in to comment.