Safe Haskell | None |
---|---|
Language | Haskell2010 |
Defines the monad for the units-of-measure modules
- type UA = Analysis (UnitAnnotation A)
- type VV = (Name, Name)
- type UnitSolver a = ExceptT UnitException (RWS UnitOpts UnitLogs UnitState) a
- data UnitOpts = UnitOpts {}
- unitOpts0 :: UnitOpts
- type UnitLogs = String
- data UnitState = UnitState {}
- data LiteralsOpt
- type UnitException = ()
- whenDebug :: UnitSolver () -> UnitSolver ()
- modifyVarUnitMap :: (VarUnitMap -> VarUnitMap) -> UnitSolver ()
- modifyGivenVarSet :: (GivenVarSet -> GivenVarSet) -> UnitSolver ()
- modifyUnitAliasMap :: (UnitAliasMap -> UnitAliasMap) -> UnitSolver ()
- type VarUnitMap = Map VV UnitInfo
- type GivenVarSet = Set Name
- type UnitAliasMap = Map String UnitInfo
- type TemplateMap = Map Name Constraints
- type CallIdMap = IntMap Int
- modifyTemplateMap :: (TemplateMap -> TemplateMap) -> UnitSolver ()
- modifyNameParamMap :: (NameParamMap -> NameParamMap) -> UnitSolver ()
- modifyProgramFile :: (ProgramFile UA -> ProgramFile UA) -> UnitSolver ()
- modifyProgramFileM :: (ProgramFile UA -> UnitSolver (ProgramFile UA)) -> UnitSolver ()
- modifyCallIdRemapM :: (CallIdMap -> UnitSolver (a, CallIdMap)) -> UnitSolver a
- runUnitSolver :: UnitOpts -> ProgramFile UA -> UnitSolver a -> (Either UnitException a, UnitState, UnitLogs)
- evalUnitSolver :: UnitOpts -> ProgramFile UA -> UnitSolver a -> (Either UnitException a, UnitLogs)
- execUnitSolver :: UnitOpts -> ProgramFile UA -> UnitSolver a -> Either UnitException (UnitState, UnitLogs)
- data CompiledUnits = CompiledUnits {}
- type NameParamMap = Map NameParamKey [UnitInfo]
- data NameParamKey
- = NPKParam PP Int
- | NPKVariable VV
- emptyCompiledUnits :: CompiledUnits
Documentation
type UnitSolver a = ExceptT UnitException (RWS UnitOpts UnitLogs UnitState) a Source #
The monad
Options for the unit solver
UnitOpts | |
|
Working state for the monad
data LiteralsOpt Source #
Some options about how to handle literals.
LitPoly | All literals are polymorphic. |
LitUnitless | All literals are unitless. |
LitMixed | The literal "0" or "0.0" is fully parametric polymorphic. All other literals are monomorphic, possibly unitless. |
type UnitException = () Source #
whenDebug :: UnitSolver () -> UnitSolver () Source #
Only run the argument if debugging mode enabled.
modifyVarUnitMap :: (VarUnitMap -> VarUnitMap) -> UnitSolver () Source #
modifyGivenVarSet :: (GivenVarSet -> GivenVarSet) -> UnitSolver () Source #
modifyUnitAliasMap :: (UnitAliasMap -> UnitAliasMap) -> UnitSolver () Source #
type GivenVarSet = Set Name Source #
Set of variables given explicit unit annotations
type TemplateMap = Map Name Constraints Source #
Function/subroutine name -> associated, parametric polymorphic constraints
modifyTemplateMap :: (TemplateMap -> TemplateMap) -> UnitSolver () Source #
modifyNameParamMap :: (NameParamMap -> NameParamMap) -> UnitSolver () Source #
modifyProgramFile :: (ProgramFile UA -> ProgramFile UA) -> UnitSolver () Source #
modifyProgramFileM :: (ProgramFile UA -> UnitSolver (ProgramFile UA)) -> UnitSolver () Source #
modifyCallIdRemapM :: (CallIdMap -> UnitSolver (a, CallIdMap)) -> UnitSolver a Source #
runUnitSolver :: UnitOpts -> ProgramFile UA -> UnitSolver a -> (Either UnitException a, UnitState, UnitLogs) Source #
Run the unit solver monad.
evalUnitSolver :: UnitOpts -> ProgramFile UA -> UnitSolver a -> (Either UnitException a, UnitLogs) Source #
execUnitSolver :: UnitOpts -> ProgramFile UA -> UnitSolver a -> Either UnitException (UnitState, UnitLogs) Source #
data CompiledUnits Source #
The data-structure stored in 'fortran-src mod files'
type NameParamMap = Map NameParamKey [UnitInfo] Source #
mapped to a list of units (to be multiplied together)
data NameParamKey Source #
Things that can be exported from modules
NPKParam PP Int | Function/subroutine name, position of parameter |
NPKVariable VV | variable |