Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Defines the CodeSpec structure and related functions.
Synopsis
- type Input = CodeVarChunk
- type Output = CodeVarChunk
- type Const = CodeDefinition
- type Derived = CodeDefinition
- type Def = CodeDefinition
- type ConstantMap = Map UID CodeDefinition
- data OldCodeSpec = OldCodeSpec {
- _pName :: Name
- _authors :: People
- _inputs :: [Input]
- _extInputs :: [Input]
- _derivedInputs :: [Derived]
- _outputs :: [Output]
- _configFiles :: [FilePath]
- _execOrder :: [Def]
- _cMap :: ConstraintCEMap
- _constants :: [Const]
- _constMap :: ConstantMap
- _mods :: [Mod]
- _sysinfodb :: ChunkDB
- class HasOldCodeSpec c where
- oldCodeSpec :: Lens' c OldCodeSpec
- authorsO :: Lens' c People
- cMapO :: Lens' c ConstraintCEMap
- configFilesO :: Lens' c [FilePath]
- 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
- sysinfodbO :: Lens' c ChunkDB
- data CodeSpec = CS {}
- sysInfo :: Lens' CodeSpec SystemInformation
- oldCode :: Lens' CodeSpec OldCodeSpec
- assocToMap :: HasUID a => [a] -> Map UID a
- getODE :: [ExtLib] -> Maybe ODE
- mapODE :: Maybe ODE -> [CodeDefinition]
- codeSpec :: SystemInformation -> Choices -> [Mod] -> CodeSpec
- oldcodeSpec :: SystemInformation -> Choices -> [Mod] -> OldCodeSpec
- asVC :: Func -> QuantityDict
- funcUID :: Func -> UID
- getDerivedInputs :: [DataDefinition] -> [Input] -> [Const] -> ChunkDB -> [SimpleQDef]
- type Known = CodeVarChunk
- type Need = CodeVarChunk
- getExecOrder :: [Def] -> [Known] -> [Need] -> ChunkDB -> [Def]
- getConstraints :: HasUID c => ConstraintCEMap -> [c] -> [ConstraintCE]
- constraintvars :: ConstraintCE -> ChunkDB -> [CodeChunk]
Documentation
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 Def = CodeDefinition Source #
Mathematical definition.
type ConstantMap = Map UID CodeDefinition Source #
Maps constants to their respective CodeDefinition
.
data OldCodeSpec Source #
Old Code specifications. Holds information needed to generate code.
OldCodeSpec | |
|
Instances
HasOldCodeSpec OldCodeSpec Source # | |
Defined in Language.Drasil.CodeSpec oldCodeSpec :: Lens' OldCodeSpec OldCodeSpec Source # authorsO :: Lens' OldCodeSpec People Source # cMapO :: Lens' OldCodeSpec ConstraintCEMap Source # configFilesO :: Lens' OldCodeSpec [FilePath] 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 # sysinfodbO :: Lens' OldCodeSpec ChunkDB Source # |
class HasOldCodeSpec c where Source #
oldCodeSpec :: Lens' c OldCodeSpec Source #
authorsO :: Lens' c People Source #
cMapO :: Lens' c ConstraintCEMap Source #
configFilesO :: Lens' c [FilePath] 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 #
pNameO :: Lens' c Name Source #
sysinfodbO :: Lens' c ChunkDB Source #
Instances
New Code Specification. Holds system information and a reference to OldCodeSpec
.
Instances
sysInfo :: Lens' CodeSpec SystemInformation Source #
oldCode :: Lens' CodeSpec OldCodeSpec Source #
mapODE :: Maybe ODE -> [CodeDefinition] Source #
Maps ODE to their respective CodeDefinition
.
codeSpec :: SystemInformation -> Choices -> [Mod] -> CodeSpec Source #
Creates a CodeSpec
using the provided SystemInformation
, Choices
, and Mod
s.
The CodeSpec
consists of the system information and a corresponding OldCodeSpec
.
oldcodeSpec :: SystemInformation -> Choices -> [Mod] -> OldCodeSpec Source #
Generates an OldCodeSpec
from SystemInformation
, Choices
, and a list of Mod
s.
This function extracts various components (e.g., inputs, outputs, constraints, etc.)
from SystemInformation
to populate the OldCodeSpec
structure.
asVC :: Func -> QuantityDict Source #
Convert a Func
to an implementation-stage QuantityDict
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 QDefinition
s are used instead.
type Known = CodeVarChunk Source #
Known values.
type Need = CodeVarChunk Source #
Calculated values.
getConstraints :: HasUID c => ConstraintCEMap -> [c] -> [ConstraintCE] Source #
Get a list of Constraint
s for a list of CodeChunk
s.
constraintvars :: ConstraintCE -> ChunkDB -> [CodeChunk] Source #
Get a list of CodeChunk
s from a constraint.