Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Defines chunks to add units to a quantity. Similar to UnitalChunk
.
Synopsis
- class Quantity c => Unitary c where
- data UnitaryChunk
- mkUnitary :: (Unitary u, MayHaveUnit u) => u -> UnitaryChunk
- unitary :: IsUnit u => String -> NP -> Symbol -> u -> Space -> UnitaryChunk
- unitary' :: IsUnit u => String -> NP -> (Stage -> Symbol) -> u -> Space -> UnitaryChunk
- unit_symb :: Unitary c => c -> USymb
Chunk Types
class Quantity c => Unitary c where Source #
A Unitary is a Quantity
that must have a unit.
Instances
Unitary UnitalChunk Source # | Finds the unit definition of a |
Defined in Language.Drasil.Chunk.Unital unit :: UnitalChunk -> UnitDefn Source # | |
Unitary UnitaryChunk Source # | Finds the unit definition of a |
Defined in Language.Drasil.Chunk.Unitary unit :: UnitaryChunk -> UnitDefn Source # |
data UnitaryChunk Source #
UnitaryChunks are for ideas with quantities that must have units. Contains a QuantityDict
and a UnitDefn
.
Ex. A pendulum arm is an idea associated with a symbol (l) and units (cm, m, etc.).
Instances
Constructors
mkUnitary :: (Unitary u, MayHaveUnit u) => u -> UnitaryChunk Source #
Makes a UnitaryChunk
from a quantity with a unit.
unitary :: IsUnit u => String -> NP -> Symbol -> u -> Space -> UnitaryChunk Source #
Builds the QuantityDict
part from the UID
, term (NP
), Symbol
, and Space
.
Assumes there's no abbreviation.