| 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 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]
 - _systemdb :: 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
 - systemdbO :: Lens' c ChunkDB
 
 - data CodeSpec = CS {}
 - system' :: Lens' CodeSpec System
 - oldCode :: Lens' CodeSpec OldCodeSpec
 - assocToMap :: HasUID a => [a] -> Map UID a
 - getODE :: [ExtLib] -> Maybe ODE
 - mapODE :: Maybe ODE -> [CodeDefinition]
 - codeSpec :: System -> Choices -> [Mod] -> CodeSpec
 - oldcodeSpec :: System -> Choices -> [Mod] -> OldCodeSpec
 - asVC :: Func -> DefinedQuantityDict
 - funcUID :: Func -> UID
 - getDerivedInputs :: [DataDefinition] -> [Input] -> [Const] -> ChunkDB -> [SimpleQDef]
 - 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 ConstantMap = Map UID CodeDefinition Source #
Maps constants to their respective CodeDefinition.
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 [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 # systemdbO :: Lens' OldCodeSpec ChunkDB Source #  | |
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 [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 #
Instances
New Code Specification. Holds system information and a reference to OldCodeSpec.
Constructors
| CS | |
Fields 
  | |
Instances
oldCode :: Lens' CodeSpec OldCodeSpec Source #
mapODE :: Maybe ODE -> [CodeDefinition] Source #
Maps ODE to their respective CodeDefinition.
codeSpec :: System -> Choices -> [Mod] -> CodeSpec Source #
Creates a CodeSpec using the provided System, Choices, and Mods.
 The CodeSpec consists of the system information and a corresponding OldCodeSpec.
oldcodeSpec :: System -> Choices -> [Mod] -> OldCodeSpec Source #
Generates an OldCodeSpec from System, Choices, and a list of Mods.
 This function extracts various components (e.g., inputs, outputs, constraints, etc.)
 from System to populate the OldCodeSpec structure.
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.