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

Drasil.Code.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 #

data VarOrFunc Source #

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

Constructors

Var 
Func 

Instances

Instances details
Generic VarOrFunc Source # 
Instance details

Defined in Drasil.Code.CodeVar

Associated Types

type Rep VarOrFunc :: Type -> Type #

HasChunkRefs VarOrFunc Source # 
Instance details

Defined in Drasil.Code.CodeVar

Methods

chunkRefs :: VarOrFunc -> Set UID #

type Rep VarOrFunc Source # 
Instance details

Defined in Drasil.Code.CodeVar

type Rep VarOrFunc = D1 ('MetaData "VarOrFunc" "Drasil.Code.CodeVar" "drasil-lang-0.1.60.0-GSVjWL6zqIJGx21JJ17VJN" 'False) (C1 ('MetaCons "Var" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Func" 'PrefixI 'False) (U1 :: Type -> Type))

data CodeChunk Source #

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

Constructors

CodeC 

Instances

Instances details
Generic CodeChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

Associated Types

type Rep CodeChunk :: Type -> Type #

HasChunkRefs CodeChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

Methods

chunkRefs :: CodeChunk -> Set UID #

HasUID CodeChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

Methods

uid :: Getter CodeChunk UID #

Idea CodeChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

NamedIdea CodeChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

Methods

term :: Lens' CodeChunk NP Source #

MayHaveUnit CodeChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

ConceptDomain CodeChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

Methods

cdom :: CodeChunk -> [UID] Source #

Definition CodeChunk Source #

Finds the Definition contained in the DefinedQuantityDict used to make the CodeChunk

Instance details

Defined in Drasil.Code.CodeVar

Methods

defn :: Lens' CodeChunk Sentence Source #

HasSpace CodeChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

Methods

typ :: Getter CodeChunk Space Source #

HasSymbol CodeChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

Eq CodeChunk Source #

Equal if UIDs are equal.

Instance details

Defined in Drasil.Code.CodeVar

type Rep CodeChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

type Rep CodeChunk = D1 ('MetaData "CodeChunk" "Drasil.Code.CodeVar" "drasil-lang-0.1.60.0-GSVjWL6zqIJGx21JJ17VJN" 'False) (C1 ('MetaCons "CodeC" 'PrefixI 'True) (S1 ('MetaSel ('Just "_qc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DefinedQuantityDict) :*: S1 ('MetaSel ('Just "kind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarOrFunc)))

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
Generic CodeVarChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

Associated Types

type Rep CodeVarChunk :: Type -> Type #

HasChunkRefs CodeVarChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

HasUID CodeVarChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

Methods

uid :: Getter CodeVarChunk UID #

Idea CodeVarChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

NamedIdea CodeVarChunk Source #

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

Instance details

Defined in Drasil.Code.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 Drasil.Code.CodeVar

ConceptDomain CodeVarChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

Methods

cdom :: CodeVarChunk -> [UID] Source #

Definition CodeVarChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

HasSpace CodeVarChunk Source #

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

Instance details

Defined in Drasil.Code.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 Drasil.Code.CodeVar

Eq CodeVarChunk Source #

Equal if UIDs are equal.

Instance details

Defined in Drasil.Code.CodeVar

type Rep CodeVarChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

type Rep CodeVarChunk = D1 ('MetaData "CodeVarChunk" "Drasil.Code.CodeVar" "drasil-lang-0.1.60.0-GSVjWL6zqIJGx21JJ17VJN" 'False) (C1 ('MetaCons "CodeVC" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ccv") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CodeChunk) :*: S1 ('MetaSel ('Just "_obv") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe CodeChunk))))

newtype CodeFuncChunk Source #

Chunk representing a function.

Constructors

CodeFC 

Fields

Instances

Instances details
Generic CodeFuncChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

Associated Types

type Rep CodeFuncChunk :: Type -> Type #

HasChunkRefs CodeFuncChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

HasUID CodeFuncChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

Methods

uid :: Getter CodeFuncChunk UID #

Callable CodeFuncChunk Source #

Functions are Callable.

Instance details

Defined in Drasil.Code.CodeVar

Idea CodeFuncChunk Source #

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

Instance details

Defined in Drasil.Code.CodeVar

NamedIdea CodeFuncChunk Source #

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

Instance details

Defined in Drasil.Code.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 Drasil.Code.CodeVar

ConceptDomain CodeFuncChunk Source #

Finds the ConceptDomain of the CodeChunk used to make the CodeFuncChunk

Instance details

Defined in Drasil.Code.CodeVar

Methods

cdom :: CodeFuncChunk -> [UID] Source #

Definition CodeFuncChunk Source #

Finds the Definition of the CodeChunk used to make the CodeFuncChunk

Instance details

Defined in Drasil.Code.CodeVar

HasSpace CodeFuncChunk Source #

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

Instance details

Defined in Drasil.Code.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 Drasil.Code.CodeVar

Eq CodeFuncChunk Source #

Equal if UIDs are equal.

Instance details

Defined in Drasil.Code.CodeVar

type Rep CodeFuncChunk Source # 
Instance details

Defined in Drasil.Code.CodeVar

type Rep CodeFuncChunk = D1 ('MetaData "CodeFuncChunk" "Drasil.Code.CodeVar" "drasil-lang-0.1.60.0-GSVjWL6zqIJGx21JJ17VJN" 'True) (C1 ('MetaCons "CodeFC" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ccf") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CodeChunk)))

funcPrefix :: String Source #

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