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

Language.Drasil.Classes

Description

Defining all the classes which represent knowledge-about-knowledge.

Synopsis

Classes

Chunks

class HasUID c => NamedIdea c where Source #

A NamedIdea is a term that we've identified (has a UID) as being worthy of naming.

Methods

term :: Lens' c NP Source #

Lens to the term (a noun phrase).

Instances

Instances details
NamedIdea CodeChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

term :: Lens' CodeChunk NP Source #

NamedIdea CodeFuncChunk Source #

Finds the term (NP) of the CodeChunk used to make the CodeFuncChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

term :: Lens' CodeFuncChunk NP Source #

NamedIdea CodeVarChunk Source #

Finds the term (NP) of the CodeChunk used to make the CodeVarChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

term :: Lens' CodeVarChunk NP Source #

NamedIdea CI Source #

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

Instance details

Defined in Language.Drasil.Chunk.CommonIdea

Methods

term :: Lens' CI NP Source #

NamedIdea ConceptChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Concept.Core

Methods

term :: Lens' ConceptChunk NP Source #

NamedIdea ConceptInstance Source #

Finds term (NP) of the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Chunk.Concept.Core

Methods

term :: Lens' ConceptInstance NP Source #

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 #

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 #

NamedIdea DefinedQuantityDict Source #

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

Instance details

Defined in Language.Drasil.Chunk.DefinedQuantity

NamedIdea DifferentialModel Source #

Finds the term (NP) of the ConceptChunk used to make the DifferentialModel.

Instance details

Defined in Language.Drasil.Chunk.DifferentialModel

Methods

term :: Lens' DifferentialModel NP Source #

NamedIdea IdeaDict Source #

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

Instance details

Defined in Language.Drasil.Chunk.NamedIdea

Methods

term :: Lens' IdeaDict NP Source #

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 #

NamedIdea RelationConcept Source #

Finds the term (NP) of the ConceptChunk used to make the RelationConcept.

Instance details

Defined in Language.Drasil.Chunk.Relation

Methods

term :: Lens' RelationConcept NP Source #

NamedIdea UncertQ Source #

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

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Methods

term :: Lens' UncertQ NP Source #

NamedIdea UncertainChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Methods

term :: Lens' UncertainChunk NP Source #

NamedIdea UnitDefn Source #

Finds term (NP) of the ConceptChunk used to make the UnitDefn.

Instance details

Defined in Language.Drasil.Chunk.UnitDefn

Methods

term :: Lens' UnitDefn NP Source #

NamedIdea UnitalChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Unital

Methods

term :: Lens' UnitalChunk NP Source #

NamedIdea UnitaryChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Unitary

Methods

term :: Lens' UnitaryChunk NP Source #

NamedIdea (QDefinition e) Source # 
Instance details

Defined in Language.Drasil.Chunk.Eq

Methods

term :: Lens' (QDefinition e) NP Source #

class NamedIdea c => Idea c where Source #

An Idea is the combination of a NamedIdea and a CommonIdea. In other words, it may have an acronym/abbreviation.

Methods

getA :: c -> Maybe String Source #

Gets the acronym/abbreviation.

Instances

Instances details
Idea CodeChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Idea CodeFuncChunk Source #

Finds the idea contained in the CodeChunk used to make the CodeFuncChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Idea CodeVarChunk Source #

Finds the idea contained in the CodeChunk used to make the CodeVarChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Idea CI Source #

Finds the idea of a CI (abbreviation).

Instance details

Defined in Language.Drasil.Chunk.CommonIdea

Methods

getA :: CI -> Maybe String Source #

Idea ConceptChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Concept.Core

Idea ConceptInstance Source #

Finds the idea contained in the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Chunk.Concept.Core

Idea ConstrConcept Source #

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

Instance details

Defined in Language.Drasil.Chunk.Constrained

Idea ConstrainedChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Constrained

Idea DefinedQuantityDict Source #

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

Instance details

Defined in Language.Drasil.Chunk.DefinedQuantity

Idea DifferentialModel Source #

Finds the idea contained in the ConceptChunk used to make the DifferentialModel.

Instance details

Defined in Language.Drasil.Chunk.DifferentialModel

Idea IdeaDict Source #

Finds the abbreviation of the IdeaDict.

Instance details

Defined in Language.Drasil.Chunk.NamedIdea

Idea QuantityDict Source #

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

Instance details

Defined in Language.Drasil.Chunk.Quantity

Idea RelationConcept Source #

Finds the idea contained in the ConceptChunk used to make the RelationConcept.

Instance details

Defined in Language.Drasil.Chunk.Relation

Idea UncertQ Source #

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

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Idea UncertainChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Idea UnitDefn Source #

Finds the idea contained in the ConceptChunk used to make the UnitDefn.

Instance details

Defined in Language.Drasil.Chunk.UnitDefn

Idea UnitalChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Unital

Idea UnitaryChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Unitary

Idea (QDefinition e) Source # 
Instance details

Defined in Language.Drasil.Chunk.Eq

class NamedIdea c => CommonIdea c where Source #

CommonIdea is a NamedIdea with the additional constraint that it must have an abbreviation.

Methods

abrv :: c -> String Source #

Introduces abrv which necessarily provides an abbreviation.

Instances

Instances details
CommonIdea CI Source #

Finds the idea of a CI (abbreviation).

Instance details

Defined in Language.Drasil.Chunk.CommonIdea

Methods

abrv :: CI -> String Source #

type Concept c = (Idea c, Definition c, ConceptDomain c) Source #

Concepts are Ideas with definitions and domains.

class Definition c where Source #

Defines a chunk.

Methods

defn :: Lens' c Sentence Source #

Provides (a Lens to) the definition for a chunk.

Instances

Instances details
Definition ConceptChunk Source #

Finds definition of a ConceptChunk.

Instance details

Defined in Language.Drasil.Chunk.Concept.Core

Definition ConceptInstance Source #

Finds the definition contained in the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Chunk.Concept.Core

Definition ConstrConcept Source #

Finds definition of the DefinedQuantityDict used to make the ConstrConcept.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Definition DefinedQuantityDict Source #

Finds the definition contained in the ConceptChunk used to make the DefinedQuantityDict.

Instance details

Defined in Language.Drasil.Chunk.DefinedQuantity

Definition DifferentialModel Source #

Finds the definition contained in the ConceptChunk used to make the DifferentialModel.

Instance details

Defined in Language.Drasil.Chunk.DifferentialModel

Definition RelationConcept Source #

Finds the definition contained in the ConceptChunk used to make the RelationConcept.

Instance details

Defined in Language.Drasil.Chunk.Relation

Definition UncertQ Source #

Finds definition of the ConstrConcept used to make the UncertQ.

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Methods

defn :: Lens' UncertQ Sentence Source #

Definition UnitDefn Source #

Finds definition of the ConceptChunk used to make the UnitDefn.

Instance details

Defined in Language.Drasil.Chunk.UnitDefn

Methods

defn :: Lens' UnitDefn Sentence Source #

Definition UnitalChunk Source #

Finds definition of the DefinedQuantityDict used to make the UnitalChunk.

Instance details

Defined in Language.Drasil.Chunk.Unital

Methods

defn :: Lens' UnitalChunk Sentence Source #

Definition (QDefinition e) Source # 
Instance details

Defined in Language.Drasil.Chunk.Eq

Methods

defn :: Lens' (QDefinition e) Sentence Source #

class ConceptDomain c where Source #

Some concepts have a domain (related information encoded in UIDs to other chunks).

Methods

cdom :: c -> [UID] Source #

Provides Getter for the concept domain tags for a chunk

cdom should be exported for use by the Drasil framework, but should not be exported beyond that.

Instances

Instances details
ConceptDomain CI Source #

Finds the domain of a CI.

Instance details

Defined in Language.Drasil.Chunk.CommonIdea

Methods

cdom :: CI -> [UID] Source #

ConceptDomain ConceptChunk Source #

Finds the domain of UIDs of a ConceptChunk.

Instance details

Defined in Language.Drasil.Chunk.Concept.Core

Methods

cdom :: ConceptChunk -> [UID] Source #

ConceptDomain ConceptInstance Source #

Finds the domain contained in the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Chunk.Concept.Core

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 #

ConceptDomain DefinedQuantityDict Source #

Finds the domain of the ConceptChunk used to make the DefinedQuantityDict.

Instance details

Defined in Language.Drasil.Chunk.DefinedQuantity

ConceptDomain DifferentialModel Source #

Finds the domain of the ConceptChunk used to make the DifferentialModel.

Instance details

Defined in Language.Drasil.Chunk.DifferentialModel

ConceptDomain RelationConcept Source #

Finds the domain of the ConceptChunk used to make the RelationConcept.

Instance details

Defined in Language.Drasil.Chunk.Relation

ConceptDomain UncertQ Source #

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

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Methods

cdom :: UncertQ -> [UID] Source #

ConceptDomain UnitDefn Source #

Finds the domain contained in the ConceptChunk used to make the UnitDefn.

Instance details

Defined in Language.Drasil.Chunk.UnitDefn

Methods

cdom :: UnitDefn -> [UID] Source #

ConceptDomain UnitalChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Unital

Methods

cdom :: UnitalChunk -> [UID] Source #

ConceptDomain (QDefinition e) Source # 
Instance details

Defined in Language.Drasil.Chunk.Eq

Methods

cdom :: QDefinition e -> [UID] Source #

class (Idea c, HasSpace c, HasSymbol c) => Quantity c Source #

A Quantity is an Idea with a Space and a Symbol. In theory, it should also restrict to being a part of MayHaveUnit, but that causes all sorts of import cycles (or lots of orphans).

class HasUnitSymbol u where Source #

Some chunks store a unit symbol.

Methods

usymb :: u -> USymb Source #

Provides the ability to hold a unit symbol (USymb).

Instances

Instances details
HasUnitSymbol UnitDefn Source #

Finds unit symbol of the ConceptChunk used to make the UnitDefn.

Instance details

Defined in Language.Drasil.Chunk.UnitDefn

Methods

usymb :: UnitDefn -> USymb Source #

class HasReasVal c where Source #

A Quantity that could have a reasonable value.

Methods

reasVal :: Lens' c (Maybe Expr) Source #

Provides a Lens to the possible reasonable value.

Instances

Instances details
HasReasVal ConstrConcept Source #

Finds a reasonable value for the ConstrConcept.

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

HasReasVal UncertQ Source #

Finds a reasonable value for the ConstrConcept used to make the UncertQ.

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Methods

reasVal :: Lens' UncertQ (Maybe Expr) Source #

HasReasVal UncertainChunk Source #

Finds a reasonable value for the ConstrainedChunk used to make the UncertainChunk.

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

class Constrained c where Source #

The Constrained class is a Quantity that has value constraints. It does not enforce Quantity at this point.

Methods

constraints :: Lens' c [ConstraintE] Source #

Provides a Lens to the Constraints.

Instances

Instances details
Constrained ConstrConcept Source #

Finds the Constraints of a ConstrConcept.

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

Constrained UncertQ Source #

Finds the Constraints of a ConstrConcept used to make the UncertQ.

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Constrained UncertainChunk Source #

Finds the Constraints of the ConstrainedChunk used to make the UncertainChunk.

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

class HasSymbol c => Callable c Source #

Some chunks can be called like functions.

Instances

Instances details
Callable CodeFuncChunk Source #

Functions are Callable.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

class HasSymbol c => IsArgumentName c Source #

Members must have a named argument.

class HasAdditionalNotes c where Source #

Records any additional notes needed to avoid losing information

Methods

getNotes :: Lens' c [Sentence] Source #

Provides a Lens to the notes.

class (Idea u, Definition u, HasUnitSymbol u) => IsUnit u where Source #

Units are Ideas with a Definition which store a unit symbol. They must also be explicitly declared to be instances of IsUnit.

Methods

udefn :: u -> Maybe UDefn Source #

May have a unit definition.

getUnits :: u -> [UID] Source #

Holds units as a list of UID.

Instances

Instances details
IsUnit UnitDefn Source #

Gets the UnitDefn and contributing units.

Instance details

Defined in Language.Drasil.Chunk.UnitDefn

class UnitEq u where Source #

Contains a UDefn

Methods

uniteq :: Lens' u UDefn Source #

Provides the Lens to a unit definition.

Expr and expressions

class Express c where Source #

Data that can be expressed using ModelExpr.

Methods

express :: c -> ModelExpr Source #

Instances

Instances details
Express ConstrConcept Source #

Convert the symbol of the ConstrConcept to a ModelExpr.

Instance details

Defined in Language.Drasil.Chunk.Constrained

Express DefinedQuantityDict Source #

Convert the symbol of the DefinedQuantityDict to a ModelExpr.

Instance details

Defined in Language.Drasil.Chunk.DefinedQuantity

Express DifferentialModel Source #

Convert the DifferentialModel into the model expression language.

Instance details

Defined in Language.Drasil.Chunk.DifferentialModel

Express QuantityDict Source #

Convert the symbol of the QuantityDict to a ModelExpr.

Instance details

Defined in Language.Drasil.Chunk.Quantity

Express RelationConcept Source #

Convert the RelationConcept into the model expression language.

Instance details

Defined in Language.Drasil.Chunk.Relation

Express UncertQ Source #

Convert the symbol of the UncertQ to a ModelExpr.

Instance details

Defined in Language.Drasil.Chunk.UncertainQuantity

Express UnitalChunk Source #

Convert the symbol of the UnitalChunk to a ModelExpr.

Instance details

Defined in Language.Drasil.Chunk.Unital

Express Expr Source #

Rewriting Exprs using the ModelExpr language.

Instance details

Defined in Language.Drasil.ExprClasses

Express Literal Source # 
Instance details

Defined in Language.Drasil.ExprClasses

Express ModelExpr Source #

No change, it's already a ModelExpr.

Instance details

Defined in Language.Drasil.ExprClasses

Express e => Express (QDefinition e) Source # 
Instance details

Defined in Language.Drasil.Chunk.Eq

class DefiningExpr c where Source #

Methods

defnExpr :: Lens' (c e) e Source #

Provides a Lens to the expression. TODO: Well, technically, e doesn't need to be an "expression" of any sorts. It just needs to be _something_, and it would have approximately have same meaning.

Instances

Instances details
DefiningExpr QDefinition Source # 
Instance details

Defined in Language.Drasil.Chunk.Eq

Methods

defnExpr :: Lens' (QDefinition e) e Source #