Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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 :: QuantityDict
- kind :: VarOrFunc
- qc :: Lens' CodeChunk QuantityDict
- 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.
Basic chunk representation in the code generation context. Contains a QuantityDict and the kind of code (variable or function).
CodeC | |
|
Instances
Idea CodeChunk Source # | Finds the idea contained in the |
NamedIdea CodeChunk Source # | Finds the term ( |
MayHaveUnit CodeChunk Source # | Finds the units of the |
Quantity CodeChunk Source # | |
Defined in Language.Drasil.Chunk.CodeVar | |
HasSpace CodeChunk Source # | Finds the |
HasSymbol CodeChunk Source # | Finds the |
HasUID CodeChunk Source # | Finds the |
Eq CodeChunk Source # | Equal if |
qc :: Lens' CodeChunk QuantityDict 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 #