drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Chunk.Quantity

Description

Defines chunks that add quantities to an idea. Similar to DefinedQuantityDict.

Synopsis

Chunk Type

data QuantityDict Source #

QuantityDict is a combination of an IdeaDict with a quantity. Contains an IdeaDict, Space, a function from Stage -> Symbol, and Maybe a UnitDefn.

Ex. A pendulum arm does not necessarily have to be defined as a concept before we assign a space (Real numbers), a symbol (l), or units (cm, m, etc.).

Instances

Instances details
Idea QuantityDict Source #

Finds the idea contained in the IdeaDict used to make the QuantityDict.

Instance details

Defined in Language.Drasil.Chunk.Quantity

NamedIdea QuantityDict Source #

Finds the term (NP) of the IdeaDict used to make the QuantityDict.

Instance details

Defined in Language.Drasil.Chunk.Quantity

Methods

term :: Lens' QuantityDict NP Source #

MayHaveUnit QuantityDict Source #

Finds the units of the QuantityDict.

Instance details

Defined in Language.Drasil.Chunk.Quantity

Quantity QuantityDict Source #

QuantityDicts have a Quantity.

Instance details

Defined in Language.Drasil.Chunk.Quantity

Express QuantityDict Source #

Convert the symbol of the QuantityDict to a ModelExpr.

Instance details

Defined in Language.Drasil.Chunk.Quantity

HasSpace QuantityDict Source #

Finds the Space of the QuantityDict.

Instance details

Defined in Language.Drasil.Chunk.Quantity

Methods

typ :: Getter QuantityDict Space Source #

HasSymbol QuantityDict Source #

Finds the Stage dependent Symbol of the QuantityDict.

Instance details

Defined in Language.Drasil.Chunk.Quantity

HasUID QuantityDict Source #

Finds the UID of the IdeaDict used to make the QuantityDict.

Instance details

Defined in Language.Drasil.Chunk.Quantity

Methods

uid :: Lens' QuantityDict UID Source #

Eq QuantityDict Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Chunk.Quantity

Class

class DefinesQuantity d where Source #

Methods

defLhs :: Getter d QuantityDict Source #

Instances

Instances details
DefinesQuantity (QDefinition e) Source # 
Instance details

Defined in Language.Drasil.Chunk.Eq

Methods

defLhs :: Getter (QDefinition e) QuantityDict Source #

Constructors

codeVC :: Idea c => c -> Symbol -> Space -> QuantityDict Source #

Makes a QuantityDict from an Idea, Symbol, and Space. Symbol is implementation-only.

implVar :: String -> NP -> Space -> Symbol -> QuantityDict Source #

Makes a variable that is implementation-only.

implVar' :: String -> NP -> Maybe String -> Space -> Symbol -> Maybe UnitDefn -> QuantityDict Source #

Similar to implVar but allows specification of abbreviation and unit.

implVarUID :: UID -> NP -> Space -> Symbol -> QuantityDict Source #

Similar to implVar but takes in a UID rather than a String.

implVarUID' :: UID -> NP -> Maybe String -> Space -> Symbol -> Maybe UnitDefn -> QuantityDict Source #

Similar to implVar' but takes in a UID rather than a String.

mkQuant :: String -> NP -> Symbol -> Space -> Maybe UnitDefn -> Maybe String -> QuantityDict Source #

Make a QuantityDict from a UID, NP, Symbol, Space, Maybe UnitDefn, and an abbreviation (Maybe String).

mkQuant' :: String -> NP -> Maybe String -> Space -> (Stage -> Symbol) -> Maybe UnitDefn -> QuantityDict Source #

Similar to mkQuant, but the abbreviation is moved to the third argument (Maybe String), and the Symbol is now dependent on Stage.

qw :: (Quantity q, MayHaveUnit q) => q -> QuantityDict Source #

Smart constructor for a QuantityDict from another Quantity with units.

vc :: String -> NP -> Symbol -> Space -> QuantityDict Source #

Creates a QuantityDict from a UID, term (NP), Symbol, and Space.

vc'' :: Idea c => c -> Symbol -> Space -> QuantityDict Source #

Creates a QuantityDict from an Idea, Symbol, and Space.

vcSt :: String -> NP -> (Stage -> Symbol) -> Space -> QuantityDict Source #

Similar to vc, but creates a QuantityDict from something that knows about Stages.

vcUnit :: String -> NP -> Symbol -> Space -> UnitDefn -> QuantityDict Source #

Creates a QuantityDict from a UID, term (NP), Symbol, Space, and unit (UnitDefn).