gleameter

Types

pub type Cubed(unit) =
  Product(Squared(unit), unit)
pub type Inverse(unit) =
  Rate(Unitless, unit)
pub type Product(unit1, unit2)
pub type Quantity(value, units) {
  Quantity(value: value)
}

Constructors

  • Quantity(value: value)
pub type Rate(dependent, independent)
pub type Squared(unit) =
  Product(unit, unit)
pub type Unitless

Constants

pub const zero: Quantity(Int, a)

Functions

pub fn add(
  lhs: Quantity(Float, a),
  rhs: Quantity(Float, a),
) -> Quantity(Float, a)
pub fn divide(
  lhs: Quantity(Float, a),
  rhs: Quantity(Float, a),
) -> Quantity(Float, a)
pub fn from(value value: Float) -> Quantity(Float, Unitless)
pub fn from_int(value value: Int) -> Quantity(Int, Unitless)
pub fn multiply(
  lhs: Quantity(Float, a),
  rhs: Quantity(Float, a),
) -> Quantity(Float, a)
pub fn over(
  lhs: Quantity(Float, a),
  rhs: Quantity(Float, b),
) -> Quantity(Float, Rate(a, b))
pub fn product(
  lhs: Quantity(Float, a),
  rhs: Quantity(Float, b),
) -> Quantity(Float, Product(a, b))
pub fn scale(
  lhs: Float,
  rhs: Quantity(Float, a),
) -> Quantity(Float, a)
pub fn subtract(
  lhs: Quantity(Float, a),
  rhs: Quantity(Float, a),
) -> Quantity(Float, a)
pub fn unwrap(value value: Quantity(Float, a)) -> Float
pub fn unwrap_int(value value: Quantity(Int, a)) -> Int
Search Document