dimensional-0.13.0.2: Statically checked physical dimensions.

Copyright | Copyright (C) 2006-2013 Bjorn Buckwalter
License | BSD3
Maintainer | bjorn.buckwalter@gmail.com
Stability | Stable
Portability | GHC only?
Safe Haskell | None
Language | Haskell98

Numeric.Units.Dimensional

Description

Please refer to the literate Haskell code for documentation of both API and implementation.

# Documentation

newtype Dimensional v d a Source

Constructors

Dimensional a |

Instances

Functor Dimensionless Source |
(Show d, Show a) => Show (Quantity d a) Source |
Enum a => Enum (Dimensional v d a) Source |
Eq a => Eq (Dimensional v d a) Source |
Ord a => Ord (Dimensional v d a) Source |

data DUnit Source

data DQuantity Source

Instances

Functor Dimensionless Source |
(Show d, Show a) => Show (Quantity d a) Source |

type Unit = Dimensional DUnit Source

type Quantity = Dimensional DQuantity Source

(*~) :: Num a => a -> Unit d a -> Quantity d a infixl 7 Source

(/~) :: Fractional a => Quantity d a -> Unit d a -> a infixl 7 Source

data Dim l m t i th n j Source

Instances

Functor Dimensionless Source |
Div d (Dim l m t i th n j) d' => Div (DExt a x d) (Dim l m t i th n j) (DExt a x d') Source |
Mul d (Dim l m t i th n j) d' => Mul (DExt a x d) (Dim l m t i th n j) (DExt a x d') Source |
(NumType l, NumType m, NumType t, NumType i, NumType th, NumType n, NumType j) => Show (Dim l m t i th n j) Source |
(Div l x l', Div m x m', Div t x t', Div i x i', Div th x th', Div n x n', Div j x j') => Root (Dim l m t i th n j) x (Dim l' m' t' i' th' n' j') Source |
(Mul l x l', Mul m x m', Mul t x t', Mul i x i', Mul th x th', Mul n x n', Mul j x j') => Pow (Dim l m t i th n j) x (Dim l' m' t' i' th' n' j') Source |
(Div (Dim l m t i th n j) d d', Negate x x') => Div (Dim l m t i th n j) (DExt a x d) (DExt a x' d') Source |
Mul (Dim l m t i th n j) d d' => Mul (Dim l m t i th n j) (DExt a x d) (DExt a x d') Source |
(Sum l l' l'', Sum m m' m'', Sum t t' t'', Sum i i' i'', Sum th th' th'', Sum n n' n'', Sum j j' j'') => Div (Dim l'' m'' t'' i'' th'' n'' j'') (Dim l' m' t' i' th' n' j') (Dim l m t i th n j) Source |
(Sum l l' l'', Sum m m' m'', Sum t t' t'', Sum i i' i'', Sum th th' th'', Sum n n' n'', Sum j j' j'') => Mul (Dim l m t i th n j) (Dim l' m' t' i' th' n' j') (Dim l'' m'' t'' i'' th'' n'' j'') Source |

type DOne = Dim Zero Zero Zero Zero Zero Zero Zero Source

type DLength = Dim Pos1 Zero Zero Zero Zero Zero Zero Source

type DMass = Dim Zero Pos1 Zero Zero Zero Zero Zero Source

type DTime = Dim Zero Zero Pos1 Zero Zero Zero Zero Source

type DElectricCurrent = Dim Zero Zero Zero Pos1 Zero Zero Zero Source

type DThermodynamicTemperature = Dim Zero Zero Zero Zero Pos1 Zero Zero Source

type DAmountOfSubstance = Dim Zero Zero Zero Zero Zero Pos1 Zero Source

type DLuminousIntensity = Dim Zero Zero Zero Zero Zero Zero Pos1 Source

type Dimensionless = Quantity DOne Source

type Length = Quantity DLength Source

type Mass = Quantity DMass Source

type Time = Quantity DTime Source

type ElectricCurrent = Quantity DElectricCurrent Source

type ThermodynamicTemperature = Quantity DThermodynamicTemperature Source

type AmountOfSubstance = Quantity DAmountOfSubstance Source

type LuminousIntensity = Quantity DLuminousIntensity Source

class Mul d d' d'' | d d' -> d'' Source

Instances

(Sum n n' n'', Mul d d' d'', DropZero (DExt a n'' d'') d''') => Mul (DExt a n d) (DExt a n' d') d''' Source |
(Sum lh lh' lh'', Sum mh mh' mh'', Sum t t' t'') => Mul (CGSDim lh mh t) (CGSDim lh' mh' t') (CGSDim lh'' mh'' t'') Source |
Mul d (Dim l m t i th n j) d' => Mul (DExt a x d) (Dim l m t i th n j) (DExt a x d') Source |
Mul (Dim l m t i th n j) d d' => Mul (Dim l m t i th n j) (DExt a x d) (DExt a x d') Source |
(Sum l l' l'', Sum m m' m'', Sum t t' t'', Sum i i' i'', Sum th th' th'', Sum n n' n'', Sum j j' j'') => Mul (Dim l m t i th n j) (Dim l' m' t' i' th' n' j') (Dim l'' m'' t'' i'' th'' n'' j'') Source |

class Div d d' d'' | d d' -> d'' Source

Instances

(Sum n'' n' n, Div d d' d'', DropZero (DExt a n'' d'') d''') => Div (DExt a n d) (DExt a n' d') d''' Source |
(Sum lh lh' lh'', Sum mh mh' mh'', Sum t t' t'') => Div (CGSDim lh'' mh'' t'') (CGSDim lh' mh' t') (CGSDim lh mh t) Source |
Div d (Dim l m t i th n j) d' => Div (DExt a x d) (Dim l m t i th n j) (DExt a x d') Source |
(Div (Dim l m t i th n j) d d', Negate x x') => Div (Dim l m t i th n j) (DExt a x d) (DExt a x' d') Source |
(Sum l l' l'', Sum m m' m'', Sum t t' t'', Sum i i' i'', Sum th th' th'', Sum n n' n'', Sum j j' j'') => Div (Dim l'' m'' t'' i'' th'' n'' j'') (Dim l' m' t' i' th' n' j') (Dim l m t i th n j) Source |

class NumType x => Pow d x d' | d x -> d' Source

Instances

(Mul n x n', Pow d x d') => Pow (DExt a n d) x (DExt a n' d') Source |
(Mul lh x lh', Mul mh x mh', Mul t x t') => Pow (CGSDim lh mh t) x (CGSDim lh' mh' t') Source |
(Mul l x l', Mul m x m', Mul t x t', Mul i x i', Mul th x th', Mul n x n', Mul j x j') => Pow (Dim l m t i th n j) x (Dim l' m' t' i' th' n' j') Source |

class NonZero x => Root d x d' | d x -> d' Source

Instances

(Div n x n', Root d x d') => Root (DExt a n d) x (DExt a n' d') Source |
(Div lh x lh', Div mh x mh', Div t x t') => Root (CGSDim lh mh t) x (CGSDim lh' mh' t') Source |
(Div l x l', Div m x m', Div t x t', Div i x i', Div th x th', Div n x n', Div j x j') => Root (Dim l m t i th n j) x (Dim l' m' t' i' th' n' j') Source |

(*) :: (Num a, Mul d d' d'') => Dimensional v d a -> Dimensional v d' a -> Dimensional v d'' a infixl 7 Source

(/) :: (Fractional a, Div d d' d'') => Dimensional v d a -> Dimensional v d' a -> Dimensional v d'' a infixl 7 Source

(^) :: (Fractional a, Pow d n d') => Dimensional v d a -> n -> Dimensional v d' a infixr 8 Source

(^+) :: (Num a, PosType n, Pow d n d') => Dimensional v d a -> n -> Dimensional v d' a infixr 8 Source

negate :: Num a => Quantity d a -> Quantity d a Source

(+) :: Num a => Quantity d a -> Quantity d a -> Quantity d a infixl 6 Source

(-) :: Num a => Quantity d a -> Quantity d a -> Quantity d a infixl 6 Source

abs :: Num a => Quantity d a -> Quantity d a Source

nroot :: (Floating a, Root d n d') => n -> Dimensional v d a -> Dimensional v d' a Source

sqrt :: (Floating a, Root d Pos2 d') => Dimensional v d a -> Dimensional v d' a Source

cbrt :: (Floating a, Root d Pos3 d') => Dimensional v d a -> Dimensional v d' a Source

(^/) :: (Floating a, Root d n d') => Dimensional v d a -> n -> Dimensional v d' a infixr 8 Source

(*~~) :: (Functor f, Num a) => f a -> Unit d a -> f (Quantity d a) infixl 7 Source

(/~~) :: (Functor f, Fractional a) => f (Quantity d a) -> Unit d a -> f a infixl 7 Source

sum :: forall d a. Num a => [Quantity d a] -> Quantity d a Source

dimensionlessLength :: Num a => [Dimensional v d a] -> Dimensionless a Source

exp :: Floating a => Dimensionless a -> Dimensionless a Source

log :: Floating a => Dimensionless a -> Dimensionless a Source

sin :: Floating a => Dimensionless a -> Dimensionless a Source

cos :: Floating a => Dimensionless a -> Dimensionless a Source

tan :: Floating a => Dimensionless a -> Dimensionless a Source

asin :: Floating a => Dimensionless a -> Dimensionless a Source

acos :: Floating a => Dimensionless a -> Dimensionless a Source

atan :: Floating a => Dimensionless a -> Dimensionless a Source

sinh :: Floating a => Dimensionless a -> Dimensionless a Source

cosh :: Floating a => Dimensionless a -> Dimensionless a Source

tanh :: Floating a => Dimensionless a -> Dimensionless a Source

asinh :: Floating a => Dimensionless a -> Dimensionless a Source

acosh :: Floating a => Dimensionless a -> Dimensionless a Source

atanh :: Floating a => Dimensionless a -> Dimensionless a Source

(**) :: Floating a => Dimensionless a -> Dimensionless a -> Dimensionless a infixr 8 Source

atan2 :: RealFloat a => Quantity d a -> Quantity d a -> Dimensionless a Source

one :: Num a => Unit DOne a Source

_0 :: Num a => Quantity d a Source

_1 :: Num a => Dimensionless a Source

_2 :: Num a => Dimensionless a Source

_3 :: Num a => Dimensionless a Source

_4 :: Num a => Dimensionless a Source

_5 :: Num a => Dimensionless a Source

_6 :: Num a => Dimensionless a Source

_7 :: Num a => Dimensionless a Source

_8 :: Num a => Dimensionless a Source

_9 :: Num a => Dimensionless a Source

pi :: Floating a => Dimensionless a Source

tau :: Floating a => Dimensionless a Source

dimUnit :: NumType n => String -> n -> Maybe String Source

prefix :: Num a => a -> Unit d a -> Unit d a Source