| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.Drasil.Code.Imperative.Modules
Synopsis
- genMain :: OOProg r vis smt md svr att prg => GenState (FS (r File))
- genMainProc :: (ProcProg r vis smt md prg, NativeVector r) => GenState (FS (r File))
- genMainFunc :: OOProg r vis smt md svr att prg => GenState (Maybe (MS (r md)))
- genMainFuncProc :: (NativeVector r, SharedProg r vis smt md) => GenState (Maybe (MS (r md)))
- genInputClass :: OOProg r vis smt md svr att prg => ClassType -> GenState (Maybe (CS (r Class)))
- genInputDerived :: OOProg r vis smt md svr att prg => VisibilityTag -> GenState (Maybe (MS (r md)))
- genInputDerivedProc :: (SharedProg r vis smt md, NativeVector r) => VisibilityTag -> GenState (Maybe (MS (r md)))
- genInputMod :: OOProg r vis smt md svr att prg => GenState [FS (r File)]
- genInputModProc :: (ProcProg r vis smt md prg, NativeVector r) => GenState [FS (r File)]
- genInputConstraints :: OOProg r vis smt md svr att prg => VisibilityTag -> GenState (Maybe (MS (r md)))
- genInputConstraintsProc :: (SharedProg r vis smt md, NativeVector r) => VisibilityTag -> GenState (Maybe (MS (r md)))
- genInputFormat :: OOProg r vis smt md svr att prg => VisibilityTag -> GenState (Maybe (MS (r md)))
- genInputFormatProc :: (SharedProg r vis smt md, NativeVector r) => VisibilityTag -> GenState (Maybe (MS (r md)))
- genConstMod :: OOProg r vis smt md svr att prg => GenState [FS (r File)]
- checkConstClass :: GenState Bool
- genConstClass :: OOProg r vis smt md svr att prg => ClassType -> GenState (Maybe (CS (r Class)))
- genCalcMod :: OOProg r vis smt md svr att prg => GenState (FS (r File))
- genCalcModProc :: (ProcProg r vis smt md prg, NativeVector r) => GenState (FS (r File))
- genCalcFunc :: OOProg r vis smt md svr att prg => CodeDefinition -> GenState (MS (r md))
- genCalcFuncProc :: (NativeVector r, SharedProg r vis smt md) => CodeDefinition -> GenState (MS (r md))
- genOutputMod :: OOProg r vis smt md svr att prg => GenState [FS (r File)]
- genOutputModProc :: (ProcProg r vis smt md prg, NativeVector r) => GenState [FS (r File)]
- genOutputFormat :: OOProg r vis smt md svr att prg => GenState (Maybe (MS (r md)))
- genOutputFormatProc :: (SharedProg r vis smt md, NativeVector r) => GenState (Maybe (MS (r md)))
- genSampleInput :: Applicative r => GenState (Maybe (r FileLayout))
Documentation
genMain :: OOProg r vis smt md svr att prg => GenState (FS (r File)) Source #
Generates a controller module.
genMainProc :: (ProcProg r vis smt md prg, NativeVector r) => GenState (FS (r File)) Source #
Generates a controller module.
genMainFunc :: OOProg r vis smt md svr att prg => GenState (Maybe (MS (r md))) Source #
Generates a main function, to act as the controller for an SCS program. The controller declares input and constant variables, then calls the functions for reading input values, calculating derived inputs, checking constraints, calculating outputs, and printing outputs. Returns Nothing if the user chose to generate a library.
genMainFuncProc :: (NativeVector r, SharedProg r vis smt md) => GenState (Maybe (MS (r md))) Source #
Generates a main function, to act as the controller for an SCS program. The controller declares input and constant variables, then calls the functions for reading input values, calculating derived inputs, checking constraints, calculating outputs, and printing outputs. Returns Nothing if the user chose to generate a library.
genInputClass :: OOProg r vis smt md svr att prg => ClassType -> GenState (Maybe (CS (r Class))) Source #
Returns Nothing if no inputs or constants are mapped to InputParameters in
the class definition map.
If any inputs or constants are defined in InputParameters, this generates
the InputParameters class containing the inputs and constants as state
variables. If the InputParameters constructor is also exported, then the
generated class also contains the input-related functions as private methods.
genInputDerived :: OOProg r vis smt md svr att prg => VisibilityTag -> GenState (Maybe (MS (r md))) Source #
Generates a function for calculating derived inputs.
genInputDerivedProc :: (SharedProg r vis smt md, NativeVector r) => VisibilityTag -> GenState (Maybe (MS (r md))) Source #
Generates a function for calculating derived inputs.
genInputMod :: OOProg r vis smt md svr att prg => GenState [FS (r File)] Source #
Generates a single module containing all input-related components.
genInputModProc :: (ProcProg r vis smt md prg, NativeVector r) => GenState [FS (r File)] Source #
Generates a single module containing all input-related components.
genInputConstraints :: OOProg r vis smt md svr att prg => VisibilityTag -> GenState (Maybe (MS (r md))) Source #
Generates function that checks constraints on the input.
genInputConstraintsProc :: (SharedProg r vis smt md, NativeVector r) => VisibilityTag -> GenState (Maybe (MS (r md))) Source #
Generates function that checks constraints on the input.
genInputFormat :: OOProg r vis smt md svr att prg => VisibilityTag -> GenState (Maybe (MS (r md))) Source #
| Generates a function for reading inputs from a file.
genInputFormatProc :: (SharedProg r vis smt md, NativeVector r) => VisibilityTag -> GenState (Maybe (MS (r md))) Source #
| Generates a function for reading inputs from a file.
genConstMod :: OOProg r vis smt md svr att prg => GenState [FS (r File)] Source #
Generates a module containing the class where constants are stored.
checkConstClass :: GenState Bool Source #
Checks if a class is needed to store constants, i.e. if constants are mapped to the constants class in the class definition map.
genConstClass :: OOProg r vis smt md svr att prg => ClassType -> GenState (Maybe (CS (r Class))) Source #
Generates a class to store constants, if constants are mapped to the Constants class in the class definition map, otherwise returns Nothing.
genCalcMod :: OOProg r vis smt md svr att prg => GenState (FS (r File)) Source #
Generates a module containing calculation functions.
genCalcModProc :: (ProcProg r vis smt md prg, NativeVector r) => GenState (FS (r File)) Source #
Generates a module containing calculation functions.
genCalcFunc :: OOProg r vis smt md svr att prg => CodeDefinition -> GenState (MS (r md)) Source #
Generates a calculation function corresponding to the CodeDefinition.
For solving ODEs, the ExtLibState containing the information needed to
generate code is found by looking it up in the external library map.
genCalcFuncProc :: (NativeVector r, SharedProg r vis smt md) => CodeDefinition -> GenState (MS (r md)) Source #
Generates a calculation function corresponding to the CodeDefinition.
For solving ODEs, the ExtLibState containing the information needed to
generate code is found by looking it up in the external library map.
genOutputMod :: OOProg r vis smt md svr att prg => GenState [FS (r File)] Source #
Generates a module containing the function for printing outputs.
genOutputModProc :: (ProcProg r vis smt md prg, NativeVector r) => GenState [FS (r File)] Source #
Generates a module containing the function for printing outputs.
genOutputFormat :: OOProg r vis smt md svr att prg => GenState (Maybe (MS (r md))) Source #
Generates a function for printing output values.
genOutputFormatProc :: (SharedProg r vis smt md, NativeVector r) => GenState (Maybe (MS (r md))) Source #
Generates a function for printing output values.
genSampleInput :: Applicative r => GenState (Maybe (r FileLayout)) Source #
Generates a sample input file compatible with the generated program, if the user chose to.