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

Description

Defines chunk types for use in code generation.

Synopsis

Documentation

class CodeIdea c where Source #

A CodeIdea must include some code and its name.

Methods

codeName :: c -> String Source #

Name of the idea.

codeChunk :: c -> CodeChunk Source #

Code chunk associated with the idea.

class CodeIdea c => DefiningCodeExpr c where Source #

A DefiningCodeExpr must have it's underlying chunk defined in the CodeExpr language.

Methods

codeExpr :: Lens' c CodeExpr Source #

programName :: CommonIdea c => c -> String Source #

Convert an abbreviation into one deemed 'code-friendly', removing spaces, and replacing special characters with underscores.

FIXME: This should NOT be treated as a getter, but something we cache local to something that has a 'program name'.

funcPrefix :: String Source #

Used when a function name needs to be distinguishable from a variable name.

data VarOrFunc Source #

Details if a piece of code is meant to be a variable or a function.

Constructors

Var 
Func 

data CodeChunk Source #

Basic chunk representation in the code generation context. Contains a QuantityDict and the kind of code (variable or function).

Constructors

CodeC 

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

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 #

MayHaveUnit CodeChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Quantity CodeChunk Source #

CodeChunks have a Quantity.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

HasSpace CodeChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

typ :: Getter CodeChunk Space Source #

HasSymbol CodeChunk Source #

Finds the Stage dependent Symbol of the QuantityDict used to make the CodeChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

HasUID CodeChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

uid :: Lens' CodeChunk UID Source #

Eq CodeChunk Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

data CodeVarChunk Source #

Chunk representing a variable. The obv field represents the object containing this variable, if it is an object field.

Constructors

CodeVC 

Instances

Instances details
Idea CodeVarChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.CodeVar

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 #

MayHaveUnit CodeVarChunk Source #

Finds the units of the CodeChunk used to make the CodeVarChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Quantity CodeVarChunk Source #

CodeVarChunks have a Quantity.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

HasSpace CodeVarChunk Source #

Finds the Space of the CodeChunk used to make the CodeVarChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

typ :: Getter CodeVarChunk Space Source #

HasSymbol CodeVarChunk Source #

Finds the Stage dependent Symbol of the CodeChunk used to make the CodeVarChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

HasUID CodeVarChunk Source #

Finds the UID of the CodeChunk used to make the CodeVarChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

uid :: Lens' CodeVarChunk UID Source #

Eq CodeVarChunk Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

newtype CodeFuncChunk Source #

Chunk representing a function.

Constructors

CodeFC 

Fields

Instances

Instances details
Idea CodeFuncChunk Source #

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

Instance details

Defined in Language.Drasil.Chunk.CodeVar

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 #

MayHaveUnit CodeFuncChunk Source #

Finds the units of the CodeChunk used to make the CodeFuncChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Callable CodeFuncChunk Source #

Functions are Callable.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Quantity CodeFuncChunk Source #

CodeFuncChunks have a Quantity.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

HasSpace CodeFuncChunk Source #

Finds the Space of the CodeChunk used to make the CodeFuncChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

typ :: Getter CodeFuncChunk Space Source #

HasSymbol CodeFuncChunk Source #

Finds the Stage dependent Symbol of the CodeChunk used to make the CodeFuncChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

HasUID CodeFuncChunk Source #

Finds the UID of the CodeChunk used to make the CodeFuncChunk.

Instance details

Defined in Language.Drasil.Chunk.CodeVar

Methods

uid :: Lens' CodeFuncChunk UID Source #

Eq CodeFuncChunk Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Chunk.CodeVar