Skip to content

Commit

Permalink
Use stopgap approaching modularity
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed May 14, 2024
1 parent d26cea8 commit 9c79982
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/quantify.scala
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,13 @@ object Quantitative extends Quantitative2:
erased given underlying[UnitsType <: Measure]: Underlying[Quantity[UnitsType], Double] = ###
erased given [UnitsType <: Measure]: CanEqual[Quantity[UnitsType], Quantity[UnitsType]] = ###

given genericDuration: GenericDuration[Quantity[Seconds[1]]] =
quantity => (quantity*1000.0).toLong
given genericDuration: GenericDuration with
type Self = Quantity[Seconds[1]]
def milliseconds(quantity: Quantity[Seconds[1]]): Long = (quantity*1000.0).toLong

given specificDuration: SpecificDuration[Quantity[Seconds[1]]] = long => Quantity(long/1000.0)
given specificDuration: SpecificDuration with
type Self = Quantity[Seconds[1]]
def duration(long: Long): Quantity[Seconds[1]] = Quantity(long/1000.0)

transparent inline given add[LeftType <: Measure, RightType <: Measure]
: AddOperator[Quantity[LeftType], Quantity[RightType]] =
Expand Down

0 comments on commit 9c79982

Please sign in to comment.