| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Language.Drasil.Classes
Description
Defining all the classes which represent knowledge-about-knowledge.
Synopsis
- class IsChunk c => NamedIdea c where
- class NamedIdea c => Idea c where
- class NamedIdea c => CommonIdea c where
- type Concept c = (Idea c, Definition c)
- class Definition c where
- class ConceptDomain c where
- type Quantity c = (Idea c, HasSpace c, HasSymbol c)
- class HasUnitSymbol u where
- class HasReasVal c where
- reasVal :: Lens' c (Maybe ReasonableValue)
- class Constrained c where
- constraints :: Lens' c [ConstraintE]
- class HasAdditionalNotes c where
- class (Idea u, Definition u, HasUnitSymbol u) => IsUnit u where
- class UnitEq u where
- class Express c where
- class DefiningExpr (c :: Type -> Type) where
- defnExpr :: Lens' (c e) e
Classes
Chunks
class IsChunk c => NamedIdea c where Source #
Instances
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.
Instances
class NamedIdea c => CommonIdea c where Source #
CommonIdea is a NamedIdea with the additional
constraint that it must have an abbreviation. This is the main
distinction between getA and abrv, where getA may return Nothing,
while abrv will always return the abbreviation.
class Definition c where Source #
Defines a chunk.
Instances
class ConceptDomain c where Source #
Some concepts have a domain (related information encoded in UIDs to other chunks).
Methods
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
| ConceptDomain ConceptChunk Source # | Finds the domain of |
Defined in Language.Drasil.Chunk.Concept.Core Methods cdom :: ConceptChunk -> [UID] Source # | |
| ConceptDomain ConceptInstance Source # | Finds the domain contained in the |
Defined in Language.Drasil.Document.ConceptInstance Methods cdom :: ConceptInstance -> [UID] Source # | |
type Quantity c = (Idea c, HasSpace c, HasSymbol 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.
Instances
| HasUnitSymbol UnitDefn Source # | Finds unit symbol of the |
class HasReasVal c where Source #
A Quantity that could have a reasonable value.
Methods
reasVal :: Lens' c (Maybe ReasonableValue) Source #
Provides a Lens to the possible reasonable value.
Instances
| HasReasVal ConstrConcept Source # | Finds a reasonable value for the |
Defined in Language.Drasil.Chunk.Constrained Methods reasVal :: Lens' ConstrConcept (Maybe ReasonableValue) Source # | |
| HasReasVal UncertQ Source # | Finds a reasonable value for the |
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.
Instances
| Constrained ConstrConcept Source # | Finds the |
Defined in Language.Drasil.Chunk.Constrained Methods constraints :: Lens' ConstrConcept [ConstraintE] Source # | |
| Constrained UncertQ Source # | Finds the |
Defined in Language.Drasil.Chunk.UncertainQuantity Methods constraints :: Lens' UncertQ [ConstraintE] Source # | |
class HasAdditionalNotes c where Source #
Records any additional notes needed to avoid losing information
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.
Contains a UDefn
Expr and expressions
class Express c where Source #
Express something axiomatically.
Methods
express :: c -> ModelExpr Source #
Express something as a single fact.
mexpress :: c -> NonEmpty ModelExpr Source #
Express something as a series of facts.
Instances
| Express ConstrConcept Source # | Convert the symbol of the |
Defined in Language.Drasil.Chunk.Constrained | |
| Express DefinedQuantityDict Source # | Convert the symbol of the |
Defined in Language.Drasil.Chunk.DefinedQuantity | |
| Express UncertQ Source # | Convert the symbol of the |
| Express Expr Source # | |
| Express Literal Source # | |
| Express ModelExpr Source # | No change, it's already a |
| Express e => Express (QDefinition e) Source # | |
Defined in Language.Drasil.Chunk.Eq | |
| Express t => Express (NonEmpty t) Source # | |
| Express t => Express [t] Source # | |
class DefiningExpr (c :: Type -> Type) 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
| DefiningExpr QDefinition Source # | |
Defined in Language.Drasil.Chunk.Eq Methods defnExpr :: Lens' (QDefinition e) e Source # | |