| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Drasil.Code.CodeVar
Description
Defines chunk types for use in code generation.
Synopsis
- class CodeIdea c where
- class CodeIdea c => DefiningCodeExpr c where
- data VarOrFunc
- data CodeChunk = CodeC {}
- qc :: Lens' CodeChunk DefinedQuantityDict
- data CodeVarChunk = CodeVC {}
- ccv :: Lens' CodeVarChunk CodeChunk
- obv :: Lens' CodeVarChunk (Maybe CodeChunk)
- newtype CodeFuncChunk = CodeFC {}
- ccf :: Iso' CodeFuncChunk CodeChunk
- funcPrefix :: String
- listToArray :: CodeVarChunk -> CodeVarChunk
- quantvar :: (Quantity c, MayHaveUnit c, Concept c) => c -> CodeVarChunk
- quantfunc :: (Quantity c, MayHaveUnit c, Concept c) => c -> CodeFuncChunk
Documentation
class CodeIdea c => DefiningCodeExpr c where Source #
A DefiningCodeExpr must have it's underlying chunk
defined in the CodeExpr language.
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
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
| HasChunkRefs CodeVarChunk Source # | |||||
Defined in Drasil.Code.CodeVar Methods chunkRefs :: CodeVarChunk -> Set UID # | |||||
| HasUID CodeVarChunk Source # | Finds the | ||||
Defined in Drasil.Code.CodeVar Methods uid :: Getter CodeVarChunk UID # | |||||
| Idea CodeVarChunk Source # | Finds the idea contained in the | ||||
Defined in Drasil.Code.CodeVar | |||||
| NamedIdea CodeVarChunk Source # | Finds the term ( | ||||
Defined in Drasil.Code.CodeVar Methods term :: Lens' CodeVarChunk NP Source # | |||||
| MayHaveUnit CodeVarChunk Source # | Finds the units of the | ||||
Defined in Drasil.Code.CodeVar | |||||
| Definition CodeVarChunk Source # | |||||
Defined in Drasil.Code.CodeVar Methods defn :: Lens' CodeVarChunk Sentence Source # | |||||
| HasSpace CodeVarChunk Source # | Finds the | ||||
Defined in Drasil.Code.CodeVar Methods typ :: Getter CodeVarChunk Space Source # | |||||
| HasSymbol CodeVarChunk Source # | Finds the | ||||
Defined in Drasil.Code.CodeVar | |||||
| Generic CodeVarChunk Source # | |||||
Defined in Drasil.Code.CodeVar Associated Types
| |||||
| Eq CodeVarChunk Source # | Equal if | ||||
Defined in Drasil.Code.CodeVar | |||||
| type Rep CodeVarChunk Source # | |||||
Defined in Drasil.Code.CodeVar type Rep CodeVarChunk = D1 ('MetaData "CodeVarChunk" "Drasil.Code.CodeVar" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" '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)))) | |||||
ccv :: Lens' CodeVarChunk CodeChunk Source #
newtype CodeFuncChunk Source #
Chunk representing a function.
Instances
| HasChunkRefs CodeFuncChunk Source # | |||||
Defined in Drasil.Code.CodeVar Methods chunkRefs :: CodeFuncChunk -> Set UID # | |||||
| HasUID CodeFuncChunk Source # | Finds the | ||||
Defined in Drasil.Code.CodeVar Methods uid :: Getter CodeFuncChunk UID # | |||||
| Callable CodeFuncChunk Source # | Functions are Callable. | ||||
Defined in Drasil.Code.CodeVar | |||||
| Idea CodeFuncChunk Source # | Finds the idea contained in the | ||||
Defined in Drasil.Code.CodeVar | |||||
| NamedIdea CodeFuncChunk Source # | Finds the term ( | ||||
Defined in Drasil.Code.CodeVar Methods term :: Lens' CodeFuncChunk NP Source # | |||||
| MayHaveUnit CodeFuncChunk Source # | Finds the units of the | ||||
Defined in Drasil.Code.CodeVar | |||||
| Definition CodeFuncChunk Source # | Finds the Definition of the | ||||
Defined in Drasil.Code.CodeVar Methods defn :: Lens' CodeFuncChunk Sentence Source # | |||||
| HasSpace CodeFuncChunk Source # | Finds the | ||||
Defined in Drasil.Code.CodeVar Methods typ :: Getter CodeFuncChunk Space Source # | |||||
| HasSymbol CodeFuncChunk Source # | Finds the | ||||
Defined in Drasil.Code.CodeVar | |||||
| Generic CodeFuncChunk Source # | |||||
Defined in Drasil.Code.CodeVar Associated Types
| |||||
| Eq CodeFuncChunk Source # | Equal if | ||||
Defined in Drasil.Code.CodeVar Methods (==) :: CodeFuncChunk -> CodeFuncChunk -> Bool # (/=) :: CodeFuncChunk -> CodeFuncChunk -> Bool # | |||||
| type Rep CodeFuncChunk Source # | |||||
Defined in Drasil.Code.CodeVar type Rep CodeFuncChunk = D1 ('MetaData "CodeFuncChunk" "Drasil.Code.CodeVar" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'True) (C1 ('MetaCons "CodeFC" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ccf") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CodeChunk))) | |||||
ccf :: Iso' CodeFuncChunk CodeChunk Source #
funcPrefix :: String Source #
Used when a function name needs to be distinguishable from a variable name.
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.