Data.Metrology.Vector

Term-level combinators

Additive operations

zero

(|+|)

(|-|)

qSum

qNegate

Multiplicative operations between non-vector quantities

(|*|)

(|/|)

(/|)

Multiplicative operations between a vector and a scalar

(*|)

(|*)

(|/)

Multiplicative operations on vectors

(|*^|)

(|^*|)

(|^/|)

(|.|)

Exponentiation

(|^)

(|^^)

qNthRoot

qSq

qCube

qSqrt

qCubeRoot

Other vector operations

qMagnitudeSq

qMagnitude

qNormalized

qProject

qCross2

qCross3

Affine operations

data Point n

type family QPoint n

(|.-.|)

(|.+^|)

(|.-^|)

qDistanceSq

qDistance

Comparison

qCompare

(|<|)

(|>|)

(|<=|)

(|>=|)

(|==|)

(|/=|)

qApprox

qNapprox

Nondimensional units, conversion between quantities and numeric values

numIn

(#)

quOf

(%)

showIn

unity

redim

convert

defaultLCSU

constant

Type-level unit combinators

data u1 :* u2

data u1 :/ u2

data unit :^ power

data prefix :@ unit

class UnitPrefix prefix

Type-level quantity combinators

type family d1 %* d2 :: *

type family d1 %/ d2 :: *

type family d %^ z :: *

Creating quantity types

data Qu a lcsu n

type MkQu_D dim

type MkQu_DLN dim

type MkQu_U unit

type MkQu_ULN unit

Creating new dimensions

class Dimension dim

Creating new units

class Unit unit

data Canonical

Numbers, the only built-in unit

data Dimensionless

data Number

type Count

quantity

LCSUs (locally coherent system of units)

type family MkLCSU pairs

data LCSU star

type family DefaultUnitOfDim dim :: *

Validity checks and assertions

type family CompatibleUnit lcsu unit :: Constraint

type family CompatibleDim lcsu dim :: Constraint

type family ConvertibleLCSUs_D dim l1 l2 :: Constraint

type family DefaultConvertibleLCSU_D dim l :: Constraint

type family DefaultConvertibleLCSU_U unit l :: Constraint

type family MultDimFactors facts

type family MultUnitFactors facts

type family UnitOfDimFactors dims lcsu :: *

Type-level integers

data Z

type family Succ z :: Z

type family Pred z :: Z

type family a #+ b :: Z

type family a #- b :: Z

type family a #* b :: Z

type family a #/ b :: Z

type family Negate z :: Z

Synonyms for small numbers

type One

type Two

type Three

type Four

type Five

type MOne

type MTwo

type MThree

type MFour

type MFive

Term-level singletons

sZero

sOne

sTwo

sThree

sFour

sFive

sMOne

sMTwo

sMThree

sMFour

sMFive

sSucc

sPred

sNegate

Internal definitions