Number.DimensionTerm
 Portability portable Stability provisional Maintainer numericprelude@henning-thielemann.de
 Contents Number type Example constructors
Description
See Algebra.DimensionTerm.
Synopsis
 newtype T u a = Cons a fromNumber :: a -> Scalar a toNumber :: Scalar a -> a fromNumberWithDimension :: C u => u -> a -> T u a toNumberWithDimension :: C u => u -> T u a -> a mapFst :: (a -> c) -> (a, b) -> (c, b) (&*&) :: (C u, C v, C a) => T u a -> T v a -> T (Mul u v) a (&/&) :: (C u, C v, C a) => T u a -> T v a -> T (Mul u (Recip v)) a mulToScalar :: (C u, C a) => T u a -> T (Recip u) a -> a divToScalar :: (C u, C a) => T u a -> T u a -> a cancelToScalar :: C u => T (Mul u (Recip u)) a -> a recip :: (C u, C a) => T u a -> T (Recip u) a unrecip :: (C u, C a) => T (Recip u) a -> T u a sqr :: (C u, C a) => T u a -> T (Sqr u) a sqrt :: (C u, C a) => T (Sqr u) a -> T u a abs :: (C u, C a) => T u a -> T u a absSignum :: (C u, C a) => T u a -> (T u a, a) (*&) :: (C u, C a) => a -> T u a -> T u a scale :: (C u, C a) => a -> T u a -> T u a rewriteDimension :: (C u, C v) => (u -> v) -> T u a -> T v a type Scalar a = T Scalar a type Length a = T Length a type Time a = T Time a type Mass a = T Mass a type Charge a = T Charge a type Angle a = T Angle a type Temperature a = T Temperature a type Information a = T Information a type Frequency a = T Frequency a type Voltage a = T Voltage a length :: a -> Length a time :: a -> Time a mass :: a -> Mass a charge :: a -> Charge a frequency :: a -> Frequency a angle :: a -> Angle a temperature :: a -> Temperature a information :: a -> Information a voltage :: a -> Voltage a
Number type
 newtype T u a Source
Constructors
 Cons a
Instances
 (C u, C a b) => C a (T u b) Eq a => Eq (T u a) Ord a => Ord (T u a) (C u, Show a) => Show (T u a) (C u, Random a) => Random (T u a) (C u, C a) => C (T u a)
 fromNumber :: a -> Scalar a Source
 toNumber :: Scalar a -> a Source
 fromNumberWithDimension :: C u => u -> a -> T u a Source
 toNumberWithDimension :: C u => u -> T u a -> a Source
 mapFst :: (a -> c) -> (a, b) -> (c, b) Source
 (&*&) :: (C u, C v, C a) => T u a -> T v a -> T (Mul u v) a Source
 (&/&) :: (C u, C v, C a) => T u a -> T v a -> T (Mul u (Recip v)) a Source
 mulToScalar :: (C u, C a) => T u a -> T (Recip u) a -> a Source
 divToScalar :: (C u, C a) => T u a -> T u a -> a Source
 cancelToScalar :: C u => T (Mul u (Recip u)) a -> a Source
 recip :: (C u, C a) => T u a -> T (Recip u) a Source
 unrecip :: (C u, C a) => T (Recip u) a -> T u a Source
 sqr :: (C u, C a) => T u a -> T (Sqr u) a Source
 sqrt :: (C u, C a) => T (Sqr u) a -> T u a Source
 abs :: (C u, C a) => T u a -> T u a Source
 absSignum :: (C u, C a) => T u a -> (T u a, a) Source
 (*&) :: (C u, C a) => a -> T u a -> T u a Source
 scale :: (C u, C a) => a -> T u a -> T u a Source
 rewriteDimension :: (C u, C v) => (u -> v) -> T u a -> T v a Source
Example constructors
 type Scalar a = T Scalar a Source
 type Length a = T Length a Source
 type Time a = T Time a Source
 type Mass a = T Mass a Source
 type Charge a = T Charge a Source
 type Angle a = T Angle a Source
 type Temperature a = T Temperature a Source
 type Information a = T Information a Source
 type Frequency a = T Frequency a Source
 type Voltage a = T Voltage a Source
 length :: a -> Length a Source
 time :: a -> Time a Source
 mass :: a -> Mass a Source
 charge :: a -> Charge a Source
 frequency :: a -> Frequency a Source
 angle :: a -> Angle a Source
 temperature :: a -> Temperature a Source
 information :: a -> Information a Source
 voltage :: a -> Voltage a Source