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

CopyrightCopyright (C) 2006-2015 Bjorn Buckwalter
LicenseBSD3
Maintainerbjorn@buckwalter.se
StabilityStable
PortabilityGHC only
Safe HaskellSafe
LanguageHaskell2010
Extensions
  • MonoLocalBinds
  • TypeFamilies
  • DataKinds
  • DeriveDataTypeable
  • AutoDeriveTypeable
  • DeriveGeneric
  • KindSignatures
  • TypeOperators
  • ExplicitNamespaces

Numeric.Units.Dimensional.Variants

Description

Provides a type level representation of Variants of dimensional values, which may be quantities or units.

Synopsis

Documentation

data Variant Source #

The kind of variants of dimensional values.

Constructors

DQuantity

The value is a quantity.

DUnit Metricality

The value is a unit, possibly a Metric unit.

Instances

Eq Variant Source # 

Methods

(==) :: Variant -> Variant -> Bool #

(/=) :: Variant -> Variant -> Bool #

Data Variant Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Variant -> c Variant #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Variant #

toConstr :: Variant -> Constr #

dataTypeOf :: Variant -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Variant) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Variant) #

gmapT :: (forall b. Data b => b -> b) -> Variant -> Variant #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Variant -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Variant -> r #

gmapQ :: (forall d. Data d => d -> u) -> Variant -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Variant -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Variant -> m Variant #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Variant -> m Variant #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Variant -> m Variant #

Ord Variant Source # 
Generic Variant Source # 

Associated Types

type Rep Variant :: * -> * #

Methods

from :: Variant -> Rep Variant x #

to :: Rep Variant x -> Variant #

type Rep Variant Source # 
type Rep Variant = D1 (MetaData "Variant" "Numeric.Units.Dimensional.Variants" "dimensional-1.0.1.3-GLZTpwvd0sh1kPDcg3GWkB" False) ((:+:) (C1 (MetaCons "DQuantity" PrefixI False) U1) (C1 (MetaCons "DUnit" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Metricality))))

data Metricality Source #

Encodes whether a unit is a metric unit, that is, whether it can be combined with a metric prefix to form a related unit.

Constructors

Metric

Capable of receiving a metric prefix.

NonMetric

Incapable of receiving a metric prefix.

Instances

Eq Metricality Source # 
Data Metricality Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Metricality -> c Metricality #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Metricality #

toConstr :: Metricality -> Constr #

dataTypeOf :: Metricality -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Metricality) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Metricality) #

gmapT :: (forall b. Data b => b -> b) -> Metricality -> Metricality #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Metricality -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Metricality -> r #

gmapQ :: (forall d. Data d => d -> u) -> Metricality -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Metricality -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Metricality -> m Metricality #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Metricality -> m Metricality #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Metricality -> m Metricality #

Ord Metricality Source # 
Generic Metricality Source # 

Associated Types

type Rep Metricality :: * -> * #

type Rep Metricality Source # 
type Rep Metricality = D1 (MetaData "Metricality" "Numeric.Units.Dimensional.Variants" "dimensional-1.0.1.3-GLZTpwvd0sh1kPDcg3GWkB" False) ((:+:) (C1 (MetaCons "Metric" PrefixI False) U1) (C1 (MetaCons "NonMetric" PrefixI False) U1))

type family (v1 :: Variant) * (v2 :: Variant) :: Variant where ... infixl 7 Source #

Forms the product of two Variants.

The product of units is a non-metric unit.

The product of quantities is a quantity.

type family Weaken (v :: Variant) :: Variant where ... Source #

Weakens a Variant by forgetting possibly uninteresting type-level information.