dimensional-1.0.1.1: Statically checked physical dimensions, using Type Families and Data Kinds.

CopyrightCopyright (C) 2006-2014 Bjorn Buckwalter
LicenseBSD3
Maintainerbjorn@buckwalter.se
StabilityStable
PortabilityGHC only?
Safe HaskellNone
LanguageHaskell2010

Numeric.Units.Dimensional.Dynamic

Contents

Description

Defines types for manipulation of units and quantities without phantom types for their dimensions.

Synopsis

Dynamic Quantities

data AnyQuantity v Source

A Quantity whose Dimension is only known dynamically.

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

data AnyUnit Source

A Unit whose Dimension is only known dynamically.

demoteUnit :: forall a d v. KnownDimension d => Unit a d v -> AnyUnit Source

Converts a Unit of statically known Dimension into an AnyUnit.

promoteUnit :: forall d. KnownDimension d => AnyUnit -> Maybe (Unit NonMetric d ExactPi) Source

Converts an AnyUnit into a Unit of statically known Dimension, or Nothing if the dimension does not match.

The result is represented in ExactPi, conversion to other representations is possible using changeRepApproximate.