Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Constraint
- type Constraints = [Constraint]
- data UnitInfo
- = UnitParamPosAbs (PP, Int)
- | UnitParamPosUse (PP, Int, Int)
- | UnitParamVarAbs (PP, VV)
- | UnitParamVarUse (PP, VV, Int)
- | UnitParamLitAbs UniqueId
- | UnitParamLitUse (UniqueId, Int)
- | UnitParamEAPAbs VV
- | UnitParamEAPUse (VV, Int)
- | UnitParamImpAbs String
- | UnitLiteral Int
- | UnitlessLit
- | UnitlessVar
- | UnitName String
- | UnitAlias String
- | UnitVar VV
- | UnitMul UnitInfo UnitInfo
- | UnitPow UnitInfo Double
- | UnitRecord [(String, UnitInfo)]
- isMonomorphic :: UnitInfo -> Bool
- isUnitless :: UnitInfo -> Bool
- type VV = (Name, Name)
- type PP = (Name, Name)
- conParamEq :: Constraint -> Constraint -> Bool
- unitParamEq :: UnitInfo -> UnitInfo -> Bool
- doubleToRationalSubset :: Double -> Maybe Rational
- pprintConstr :: Constraint -> String
- pprintUnitInfo :: UnitInfo -> String
- toUnitInfo :: UnitOfMeasure -> UnitInfo
- foldUnits :: Foldable t => t UnitInfo -> UnitInfo
- flattenUnits :: UnitInfo -> [UnitInfo]
- simplifyUnits :: UnitInfo -> UnitInfo
- colSort :: UnitInfo -> UnitInfo -> Ordering
- type SortFn = UnitInfo -> UnitInfo -> Ordering
- module Data.Data
Datatypes and Aliases
data Constraint Source #
A relation between UnitInfos
Instances
type Constraints = [Constraint] Source #
Description of the unit of an expression.
UnitParamPosAbs (PP, Int) | |
UnitParamPosUse (PP, Int, Int) | |
UnitParamVarAbs (PP, VV) | |
UnitParamVarUse (PP, VV, Int) | |
UnitParamLitAbs UniqueId | |
UnitParamLitUse (UniqueId, Int) | |
UnitParamEAPAbs VV | |
UnitParamEAPUse (VV, Int) | |
UnitParamImpAbs String | |
UnitLiteral Int | |
UnitlessLit | |
UnitlessVar | |
UnitName String | |
UnitAlias String | |
UnitVar VV | |
UnitMul UnitInfo UnitInfo | |
UnitPow UnitInfo Double | |
UnitRecord [(String, UnitInfo)] |
Instances
Eq UnitInfo Source # | |
Data UnitInfo Source # | |
Defined in Camfort.Specification.Units.Environment gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnitInfo -> c UnitInfo # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnitInfo # toConstr :: UnitInfo -> Constr # dataTypeOf :: UnitInfo -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnitInfo) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnitInfo) # gmapT :: (forall b. Data b => b -> b) -> UnitInfo -> UnitInfo # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnitInfo -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnitInfo -> r # gmapQ :: (forall d. Data d => d -> u) -> UnitInfo -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UnitInfo -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnitInfo -> m UnitInfo # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnitInfo -> m UnitInfo # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnitInfo -> m UnitInfo # | |
Ord UnitInfo Source # | |
Defined in Camfort.Specification.Units.Environment | |
Show UnitInfo Source # | |
Generic UnitInfo Source # | |
Binary UnitInfo Source # | |
Out UnitInfo Source # | |
type Rep UnitInfo Source # | |
Defined in Camfort.Specification.Units.Environment |
isMonomorphic :: UnitInfo -> Bool Source #
True iff u is monomorphic (has no parametric polymorphic pieces)
isUnitless :: UnitInfo -> Bool Source #
True iff argument matches one of the unitless constructors
Helpers
conParamEq :: Constraint -> Constraint -> Bool Source #
Constraint parametric
equality: treat all uses of a parametric
abstractions as equivalent to the abstraction.
unitParamEq :: UnitInfo -> UnitInfo -> Bool Source #
Unit parametric
equality: treat all uses of a parametric
abstractions as equivalent to the abstraction.
pprintConstr :: Constraint -> String Source #
pprintUnitInfo :: UnitInfo -> String Source #
toUnitInfo :: UnitOfMeasure -> UnitInfo Source #
Convert parser units to UnitInfo
flattenUnits :: UnitInfo -> [UnitInfo] Source #
simplifyUnits :: UnitInfo -> UnitInfo Source #
Modules (instances)
module Data.Data