Copyright | Copyright (C) 2006-2015 Bjorn Buckwalter |
---|---|
License | BSD3 |
Maintainer | bjorn@buckwalter.se |
Stability | Stable |
Portability | GHC only |
Safe Haskell | Safe |
Language | Haskell2010 |
Numeric.Units.Dimensional.Dimensions.TermLevel
Contents
Description
This module defines physical dimensions expressed in terms of the SI base dimensions, including arithmetic.
- data Dimension' = Dim' !Int !Int !Int !Int !Int !Int !Int
- class HasDimension a where
- (*) :: Dimension' -> Dimension' -> Dimension'
- (/) :: Dimension' -> Dimension' -> Dimension'
- (^) :: Dimension' -> Int -> Dimension'
- recip :: Dimension' -> Dimension'
- dOne :: Dimension'
- dLength :: Dimension'
- dMass :: Dimension'
- dTime :: Dimension'
- dElectricCurrent :: Dimension'
- dThermodynamicTemperature :: Dimension'
- dAmountOfSubstance :: Dimension'
- dLuminousIntensity :: Dimension'
- asList :: Dimension' -> [Int]
Type
data Dimension' #
A physical dimension, encoded as 7 integers, representing a factorization of the dimension into the
7 SI base dimensions. By convention they are stored in the same order as
in the Dimension
data kind.
Instances
Eq Dimension' # | |
Ord Dimension' # | |
Show Dimension' # | |
Monoid Dimension' # | The monoid of dimensions under multiplication. |
HasDimension Dimension' # | |
Access to Dimension of Dimensional Values
class HasDimension a where #
Dimensional values inhabit this class, which allows access to a term-level representation of their dimension.
Minimal complete definition
Instances
HasDimension Dimension' # | |
HasDimension AnyUnit # | |
HasDimension (AnyQuantity v) # | |
(KnownTypeInt l, KnownTypeInt m, KnownTypeInt t, KnownTypeInt i, KnownTypeInt th, KnownTypeInt n, KnownTypeInt j) => HasDimension (Proxy Dimension (Dim l m t i th n j)) # | |
KnownDimension d => HasDimension (Dimensional v d a) # | |
Dimension Arithmetic
(*) :: Dimension' -> Dimension' -> Dimension' infixl 7 #
Forms the product of two dimensions.
(/) :: Dimension' -> Dimension' -> Dimension' infixl 7 #
Forms the quotient of two dimensions.
(^) :: Dimension' -> Int -> Dimension' infixr 8 #
Raises a dimension to an integer power.
recip :: Dimension' -> Dimension' #
Forms the reciprocal of a dimension.
Synonyms for Base Dimensions
dOne :: Dimension' #
The dimension of dimensionless values.
dLength :: Dimension' #
dMass :: Dimension' #
dTime :: Dimension' #
Deconstruction
asList :: Dimension' -> [Int] #
Converts a dimension to a list of 7 integers, representing the exponent associated with each of the 7 SI base dimensions in the standard order.