| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Drasil.Code.CodeVar
Description
Defines chunk types for use in code generation.
Synopsis
- class CodeIdea c where
- class CodeIdea c => DefiningCodeExpr c where
- programName :: CommonIdea c => c -> String
- funcPrefix :: String
- data VarOrFunc
- data CodeChunk = CodeC {}
- qc :: Lens' CodeChunk DefinedQuantityDict
- data CodeVarChunk = CodeVC {}
- obv :: Lens' CodeVarChunk (Maybe CodeChunk)
- ccv :: Lens' CodeVarChunk CodeChunk
- newtype CodeFuncChunk = CodeFC {}
- ccf :: Iso' CodeFuncChunk CodeChunk
- listToArray :: CodeVarChunk -> CodeVarChunk
Documentation
class CodeIdea c => DefiningCodeExpr c where Source #
A DefiningCodeExpr must have it's underlying chunk
defined in the CodeExpr language.
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.
Details if a piece of code is meant to be a variable or a function.
Basic chunk representation in the code generation context. Contains a DefinedQuantityDict and the kind of code (variable or function).
Constructors
| CodeC | |
Fields
| |
Instances
| HasUID CodeChunk Source # | Finds the |
| Idea CodeChunk Source # | Finds the idea contained in the |
| NamedIdea CodeChunk Source # | Finds the term ( |
| MayHaveUnit CodeChunk Source # | Finds the units of the |
| ConceptDomain CodeChunk Source # | |
| Definition CodeChunk Source # | Finds the Definition contained in the |
| Quantity CodeChunk Source # | |
Defined in Drasil.Code.CodeVar | |
| HasSpace CodeChunk Source # | Finds the |
| HasSymbol CodeChunk Source # | Finds the |
| Eq CodeChunk Source # | Equal if |
qc :: Lens' CodeChunk DefinedQuantityDict Source #
data CodeVarChunk Source #
Chunk representing a variable. The obv field represents the object containing
this variable, if it is an object field.
Instances
ccv :: Lens' CodeVarChunk CodeChunk Source #
newtype CodeFuncChunk Source #
Chunk representing a function.
Instances
ccf :: Iso' CodeFuncChunk CodeChunk Source #