diff --git a/src/core/Gauge.scala b/src/core/Gauge.scala index b3e471c..dbd1186 100644 --- a/src/core/Gauge.scala +++ b/src/core/Gauge.scala @@ -17,8 +17,3 @@ object Gauge: type BeatPerMinute = BeatPerMinute.type type StepPerMinute = StepPerMinute.type type Pace = Pace.type - -trait Distance -trait Duration -trait Timestamp -trait Box diff --git a/src/core/Page.scala b/src/core/Page.scala new file mode 100644 index 0000000..bdaa58f --- /dev/null +++ b/src/core/Page.scala @@ -0,0 +1,13 @@ +package core + + +trait Page[A] extends (Mutation => Option[Mutation]) + +object Page: + given any: Page[EmptyTuple] = Some(_) + + given tuple[H, T <: Tuple](using h: Page[H], t: Page[T]): Page[H *: T] = + a => h(a).flatMap(t) + + def apply[A](using pa: Page[A]) = pa +end Page \ No newline at end of file diff --git a/src/core/package.scala b/src/core/package.scala index 390702c..ee9ca32 100644 --- a/src/core/package.scala +++ b/src/core/package.scala @@ -10,15 +10,10 @@ extension [A](a: A) inline def single: NonEmpty[A] = a -> List.empty[A] type Interval[A] = NonEmpty[A] type History[A] = NonEmpty[Interval[A]] -trait Page[A] extends (Mutation => Option[Mutation]) -object Page: - given any: Page[EmptyTuple] = Some(_) - - given tuple[H, T <: Tuple](using h: Page[H], t: Page[T]): Page[H *: T] = - a => h(a).flatMap(t) - - def apply[A](using pa: Page[A]) = pa -end Page +sealed trait Distance +sealed trait Duration +sealed trait Timestamp +sealed trait Box type Injection[A] = (HTMLElement, A) trait Inject[A] extends (Injection[A] => Unit):