| Copyright | Copyright (C) 2006-2014 Bjorn Buckwalter |
|---|---|
| License | BSD3 |
| Maintainer | bjorn@buckwalter.se |
| Stability | Stable |
| Portability | GHC only? |
| Safe Haskell | None |
| Language | Haskell2010 |
Numeric.Units.Dimensional.Dynamic
Contents
Description
Defines types for manipulation of units and quantities without phantom types for their dimensions.
- data AnyQuantity v
- demoteQuantity :: forall d v. KnownDimension d => Quantity d v -> AnyQuantity v
- promoteQuantity :: forall d v. KnownDimension d => AnyQuantity v -> Maybe (Quantity d v)
- data AnyUnit
- demoteUnit :: forall a d v. KnownDimension d => Unit a d v -> AnyUnit
- promoteUnit :: forall d. KnownDimension d => AnyUnit -> Maybe (Unit NonMetric d ExactPi)
Dynamic Quantities
data AnyQuantity v Source
Instances
| Eq v => Eq (AnyQuantity v) Source | |
| Show v => Show (AnyQuantity v) Source | |
| HasDimension (AnyQuantity v) Source |
demoteQuantity :: forall d v. KnownDimension d => Quantity d v -> AnyQuantity v Source
Converts a Quantity of statically known Dimension into an AnyQuantity.
promoteQuantity :: forall d v. KnownDimension d => AnyQuantity v -> Maybe (Quantity d v) Source
Converts an AnyQuantity into a Quantity of statically known Dimension, or Nothing if the dimension does not match.
Dynamic Units
demoteUnit :: forall a d v. KnownDimension d => Unit a d v -> AnyUnit Source
promoteUnit :: forall d. KnownDimension d => AnyUnit -> Maybe (Unit NonMetric d ExactPi) Source