p
libra
package libra
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- libra
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
-
trait
Fraction
[N <: XInt, D <: XInt] extends AnyRef
Represents a fraction
Represents a fraction
- N
the numerator
- D
the denominator
-
final
case class
Quantity
[A, D <: HList](value: A) extends AnyVal with Product with Serializable
Represents a dimensional quantity
Represents a dimensional quantity
- A
the Numeric type of the quantity e.g. Int, Float, Double
- D
the dimensions
- value
the coefficient
scala> import spire.implicits._ scala> import libra._, libra.si._ scala> Quantity[Double, Term[Length, Metre, Fraction[1, 1]] :: HNil](5.5) // represents 5.5 m scala> res0: Quantity[Double, Term[Length, Metre, Fraction[1, 1]] :: HNil] = Quantity(5.5)
Example: -
type
QuantityOf[A, D, U <: Unit[D]] = Quantity[A, ::[Term[D, U, Fraction[1, 1]], HNil]]
Aliases a quantity with single unit
-
type
Term[D, U <: Unit[_], E <: Fraction[_, _]] = (U, E) with KeyTag[D, (U, E)]
Represents a unit in a HList of units
- type TermValue[U <: Unit[_], E <: Fraction[_, _]] = (U, E)
-
trait
Unit
[D] extends AnyRef
Represents a unit of a given dimension
Value Members
- object Quantity extends Serializable