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

Description

Defines chunks to add units to a quantity. Similar to UnitalChunk.

Synopsis

Chunk Types

class Quantity c => Unitary c where Source #

A Unitary is a Quantity that must have a unit.

Methods

unit :: c -> UnitDefn Source #

Instances

Instances details
Unitary UnitalChunk Source #

Finds the unit definition of a UnitalChunk.

Instance details

Defined in Language.Drasil.Chunk.Unital

Unitary UnitaryChunk Source #

Finds the unit definition of a UnitaryChunk.

Instance details

Defined in Language.Drasil.Chunk.Unitary

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

Instances details
Idea UnitaryChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Unitary

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 #

MayHaveUnit UnitaryChunk Source #

Finds the units of the QuantityDict used to make the UnitaryChunk.

Instance details

Defined in Language.Drasil.Chunk.Unitary

Unitary UnitaryChunk Source #

Finds the unit definition of a UnitaryChunk.

Instance details

Defined in Language.Drasil.Chunk.Unitary

Quantity UnitaryChunk Source #

UnitaryChunks have a Quantity.

Instance details

Defined in Language.Drasil.Chunk.Unitary

HasSpace UnitaryChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Unitary

Methods

typ :: Getter UnitaryChunk Space Source #

HasSymbol UnitaryChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.Unitary

HasUID UnitaryChunk Source #

Finds UID of the QuantityDict used to make the UnitaryChunk.

Instance details

Defined in Language.Drasil.Chunk.Unitary

Methods

uid :: Getter UnitaryChunk UID Source #

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.

unitary' :: IsUnit u => String -> NP -> (Stage -> Symbol) -> u -> Space -> UnitaryChunk Source #

Same as unitary but with a Symbol that changes based on the Stage.

unit_symb :: Unitary c => c -> USymb Source #

Helper for getting the unit's Symbol from a chunk, as opposed to the symbols of the chunk itself.