| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.Drasil.CodeSpec
Description
Defines the CodeSpec structure and related functions.
Synopsis
- type Input = CodeVarChunk
- type Output = CodeVarChunk
- type Const = CodeDefinition
- type Derived = CodeDefinition
- type ConstantMap = Map UID CodeDefinition
- data CodeSpec
- data OldCodeSpec = OldCodeSpec {
- _pName :: Name
- _authors :: People
- _inputs :: [Input]
- _extInputs :: [Input]
- _derivedInputs :: [Derived]
- _outputs :: [Output]
- _configFiles :: [RelativeFile]
- _execOrder :: [Def]
- _cMap :: ConstraintCEMap
- _constants :: [Const]
- _constMap :: ConstantMap
- _mods :: [Mod]
- _systemdb :: ChunkDB
- class HasOldCodeSpec c where
- oldCodeSpec :: Lens' c OldCodeSpec
- authorsO :: Lens' c People
- cMapO :: Lens' c ConstraintCEMap
- configFilesO :: Lens' c [RelativeFile]
- constMapO :: Lens' c ConstantMap
- constantsO :: Lens' c [Const]
- derivedInputsO :: Lens' c [Derived]
- execOrderO :: Lens' c [Def]
- extInputsO :: Lens' c [Input]
- inputsO :: Lens' c [Input]
- modsO :: Lens' c [Mod]
- outputsO :: Lens' c [Output]
- pNameO :: Lens' c Name
- systemdbO :: Lens' c ChunkDB
- codeSpec :: SmithEtAlSRS -> Choices -> CodeSpec
- getODE :: [ExtLib] -> Maybe ODE
- mapODE :: Maybe ODE -> [CodeDefinition]
- asVC :: Func -> DefinedQuantityDict
- funcUID :: Func -> UID
- getDerivedInputs :: [DataDefinition] -> [Input] -> [Const] -> ChunkDB -> [SimpleQDef]
- getConstraints :: HasUID c => ConstraintCEMap -> [c] -> [ConstraintCE]
- constraintvars :: ConstraintCE -> ChunkDB -> [CodeChunk]
Types
type Input = CodeVarChunk Source #
Program input.
type Output = CodeVarChunk Source #
Program output.
type Const = CodeDefinition Source #
Constants in the problem.
type Derived = CodeDefinition Source #
Derived inputs.
type ConstantMap = Map UID CodeDefinition Source #
Maps constants to their respective CodeDefinition.
New Code Specification. Holds system information and a reference to OldCodeSpec.
Instances
data OldCodeSpec Source #
Old Code specifications. Holds information needed to generate code.
Constructors
| OldCodeSpec | |
Fields
| |
Instances
| HasOldCodeSpec OldCodeSpec Source # | |
Defined in Language.Drasil.CodeSpec Methods oldCodeSpec :: Lens' OldCodeSpec OldCodeSpec Source # authorsO :: Lens' OldCodeSpec People Source # cMapO :: Lens' OldCodeSpec ConstraintCEMap Source # configFilesO :: Lens' OldCodeSpec [RelativeFile] Source # constMapO :: Lens' OldCodeSpec ConstantMap Source # constantsO :: Lens' OldCodeSpec [Const] Source # derivedInputsO :: Lens' OldCodeSpec [Derived] Source # execOrderO :: Lens' OldCodeSpec [Def] Source # extInputsO :: Lens' OldCodeSpec [Input] Source # inputsO :: Lens' OldCodeSpec [Input] Source # modsO :: Lens' OldCodeSpec [Mod] Source # outputsO :: Lens' OldCodeSpec [Output] Source # pNameO :: Lens' OldCodeSpec Name Source # systemdbO :: Lens' OldCodeSpec ChunkDB Source # | |
Typeclasses
class HasOldCodeSpec c where Source #
Minimal complete definition
Methods
oldCodeSpec :: Lens' c OldCodeSpec Source #
authorsO :: Lens' c People Source #
cMapO :: Lens' c ConstraintCEMap Source #
configFilesO :: Lens' c [RelativeFile] Source #
constMapO :: Lens' c ConstantMap Source #
constantsO :: Lens' c [Const] Source #
derivedInputsO :: Lens' c [Derived] Source #
execOrderO :: Lens' c [Def] Source #
extInputsO :: Lens' c [Input] Source #
inputsO :: Lens' c [Input] Source #
modsO :: Lens' c [Mod] Source #
outputsO :: Lens' c [Output] Source #
Instances
Constructors
codeSpec :: SmithEtAlSRS -> Choices -> CodeSpec Source #
Creates a CodeSpec using the provided System, Choices, and Mods.
The CodeSpec consists of the system information and a corresponding OldCodeSpec.
ODEs
mapODE :: Maybe ODE -> [CodeDefinition] Source #
Maps ODE to their respective CodeDefinition.
Hacks
asVC :: Func -> DefinedQuantityDict Source #
Convert a Func to an implementation-stage DefinedQuantityDict representing the
function.
getDerivedInputs :: [DataDefinition] -> [Input] -> [Const] -> ChunkDB -> [SimpleQDef] Source #
Determines the derived inputs, which can be immediately calculated from the
knowns (inputs and constants). If there are DDs, the derived inputs will
come from those. If there are none, then the QDefinitions are used instead.
getConstraints :: HasUID c => ConstraintCEMap -> [c] -> [ConstraintCE] Source #
Get a list of Constraints for a list of CodeChunks.
constraintvars :: ConstraintCE -> ChunkDB -> [CodeChunk] Source #
Get a list of CodeChunks from a constraint.