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.Constrained

Description

Add constraints and a reasonable value to chunks that are quantities.

Synopsis

Constrained Chunks

From an Idea

data ConstrainedChunk Source #

ConstrainedChunks are symbolic quantities (QuantityDict) with Constraints and maybe a typical value (Maybe Expr).

Ex. Measuring the length of a pendulum would have some reasonable value (between 1 cm and 2 m) and the constraint that the length cannot be a negative value.

Instances

Instances details
Idea ConstrainedChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Constrained

NamedIdea ConstrainedChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Constrained

Methods

term :: Lens' ConstrainedChunk NP Source #

MayHaveUnit ConstrainedChunk Source #

Finds units contained in the QuantityDict used to make the ConstrainedChunk.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Constrained ConstrainedChunk Source #

Finds the Constraints of a ConstrainedChunk.

Instance details

Defined in Language.Drasil.Chunk.Constrained

HasReasVal ConstrainedChunk Source #

Finds a reasonable value for the ConstrainedChunk.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Quantity ConstrainedChunk Source #

ConstrainedChunks have a Quantity.

Instance details

Defined in Language.Drasil.Chunk.Constrained

HasSpace ConstrainedChunk Source #

Finds the Space of the QuantityDict used to make the ConstrainedChunk.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Methods

typ :: Getter ConstrainedChunk Space Source #

HasSymbol ConstrainedChunk Source #

Finds the Symbol of the QuantityDict used to make the ConstrainedChunk.

Instance details

Defined in Language.Drasil.Chunk.Constrained

HasUID ConstrainedChunk Source #

Finds UID of the QuantityDict used to make the ConstrainedChunk.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Methods

uid :: Getter ConstrainedChunk UID Source #

Eq ConstrainedChunk Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Chunk.Constrained

cuc :: IsUnit u => String -> NP -> Symbol -> u -> Space -> [ConstraintE] -> Expr -> ConstrainedChunk Source #

Creates a constrained unitary chunk from a UID, term (NP), Symbol, unit, Space, Constraints, and an Expr.

cvc :: String -> NP -> Symbol -> Space -> [ConstraintE] -> Maybe Expr -> ConstrainedChunk Source #

Creates a constrained unitary chunk from a UID, term (NP), Symbol, Space, Constraints, and a Maybe Expr (Similar to cuc but no units).

cnstrw :: (Quantity c, Constrained c, HasReasVal c, MayHaveUnit c) => c -> ConstrainedChunk Source #

Creates a new ConstrainedChunk from either a ConstrainedChunk, ConstrConcept, UncertainChunk, or an UncertQ.

From a Concept

data ConstrConcept Source #

ConstrConcepts are conceptual symbolic quantities (DefinedQuantityDict) with Constraints and maybe a reasonable value (no units!). Similar to ConstrainedChunk but includes a definition and domain.

Ex. Measuring the length of a pendulum arm could be a concept that has some reasonable value (between 1 cm and 2 m) and the constraint that the length cannot be a negative value.

Instances

Instances details
Idea ConstrConcept Source #

Finds the idea contained in the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

NamedIdea ConstrConcept Source #

Finds term (NP) of the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Methods

term :: Lens' ConstrConcept NP Source #

MayHaveUnit ConstrConcept Source #

Finds the units of the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

ConceptDomain ConstrConcept Source #

Finds the domain contained in the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Methods

cdom :: ConstrConcept -> [UID] Source #

Constrained ConstrConcept Source #

Finds the Constraints of a ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Definition ConstrConcept Source #

Finds definition of the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

HasReasVal ConstrConcept Source #

Finds a reasonable value for the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Quantity ConstrConcept Source #

ConstrConcepts have a Quantity.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Express ConstrConcept Source #

Convert the symbol of the ConstrConcept to a ModelExpr.

Instance details

Defined in Language.Drasil.Chunk.Constrained

HasSpace ConstrConcept Source #

Finds the Space of the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Methods

typ :: Getter ConstrConcept Space Source #

HasSymbol ConstrConcept Source #

Finds the Symbol of the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

HasUID ConstrConcept Source #

Finds UID of the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Methods

uid :: Getter ConstrConcept UID Source #

Eq ConstrConcept Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Chunk.Constrained

cnstrw' :: (Quantity c, Concept c, Constrained c, HasReasVal c, MayHaveUnit c) => c -> ConstrConcept Source #

Similar to cnstrw, but types must also have a Concept.

constrained' :: (Concept c, MayHaveUnit c, Quantity c) => c -> [ConstraintE] -> Expr -> ConstrConcept Source #

Creates a ConstrConcept with a quantitative concept, a list of Constraints and an Expr.

cuc' :: IsUnit u => String -> NP -> String -> Symbol -> u -> Space -> [ConstraintE] -> Expr -> ConstrConcept Source #

Creates a constrained unitary chunk from a UID, term (NP), description (String), Symbol, unit, Space, Constraints, and an Expr.

cuc'' :: IsUnit u => String -> NP -> String -> (Stage -> Symbol) -> u -> Space -> [ConstraintE] -> Expr -> ConstrConcept Source #

Similar to cuc', but Symbol is dependent on Stage.