| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.Drasil.Chunk.Code
Contents
Description
Defines chunk types for use in code generation.
Synopsis
- class CodeIdea c where
- data CodeChunk = CodeC {}
- data CodeVarChunk = CodeVC {}
- newtype CodeFuncChunk = CodeFC {}
- data VarOrFunc
- obv :: Lens' CodeVarChunk (Maybe CodeChunk)
- quantvar :: (Quantity c, MayHaveUnit c, Concept c) => c -> CodeVarChunk
- quantfunc :: (Quantity c, MayHaveUnit c, Concept c) => c -> CodeFuncChunk
- ccObjVar :: CodeVarChunk -> CodeVarChunk -> CodeVarChunk
- codevars :: CodeExpr -> ChunkDB -> [CodeVarChunk]
- codevars' :: CodeExpr -> ChunkDB -> [CodeVarChunk]
- listToArray :: CodeVarChunk -> CodeVarChunk
- funcPrefix :: String
- class CodeIdea c => DefiningCodeExpr c where
Documentation
A CodeIdea must include some code and its name.
Methods
Name of the idea.
Code chunk associated with the idea.
Instances
| CodeIdea CodeDefinition Source # | Finds the code name of a |
Defined in Language.Drasil.Chunk.CodeDefinition | |
| CodeIdea ParameterChunk Source # | Finds the code name and |
Defined in Language.Drasil.Chunk.Parameter | |
| CodeIdea CodeChunk Source # | Finds the code name of a |
| CodeIdea CodeFuncChunk Source # | Finds the code name and |
Defined in Language.Drasil.Chunk.Code | |
| CodeIdea CodeVarChunk Source # | Finds the code name and |
Defined in Language.Drasil.Chunk.Code | |
Basic chunk representation in the code generation context. Contains a DefinedQuantityDict and the kind of code (variable or function).
Constructors
| CodeC | |
Fields
| |
Instances
data CodeVarChunk #
Chunk representing a variable. The obv field represents the object containing
this variable, if it is an object field.
Instances
newtype CodeFuncChunk #
Chunk representing a function.
Instances
Details if a piece of code is meant to be a variable or a function.
obv :: Lens' CodeVarChunk (Maybe CodeChunk) #
quantvar :: (Quantity c, MayHaveUnit c, Concept c) => c -> CodeVarChunk Source #
Construct a CodeVarChunk from a Quantity.
quantfunc :: (Quantity c, MayHaveUnit c, Concept c) => c -> CodeFuncChunk Source #
Construct a CodeFuncChunk from a Quantity.
ccObjVar :: CodeVarChunk -> CodeVarChunk -> CodeVarChunk Source #
codevars :: CodeExpr -> ChunkDB -> [CodeVarChunk] Source #
Get a list of CodeChunks from an equation.
codevars' :: CodeExpr -> ChunkDB -> [CodeVarChunk] Source #
Get a list of CodeChunks from an equation (no functions).
listToArray :: CodeVarChunk -> CodeVarChunk #
funcPrefix :: String #
Used when a function name needs to be distinguishable from a variable name.
class CodeIdea c => DefiningCodeExpr c where #
A DefiningCodeExpr must have it's underlying chunk
defined in the CodeExpr language.
Instances
| DefiningCodeExpr CodeDefinition Source # | Finds the defining expression of a CodeDefinition. |
Defined in Language.Drasil.Chunk.CodeDefinition Methods codeExpr :: Lens' CodeDefinition CodeExpr # | |
Orphan instances
| CodeIdea CodeChunk Source # | Finds the code name of a |
| CodeIdea CodeFuncChunk Source # | Finds the code name and |
| CodeIdea CodeVarChunk Source # | Finds the code name and |