Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Language.Fortran.Repr.Eval.Common
Description
Common Fortran evaluation definitions.
Documentation
class Monad m => MonadFEval (m :: Type -> Type) where Source #
Monads which provide functionality to evaluate Fortran expressions in some static context.
Actions in this monad may
- request the value of a variable (may return
Nothing
if not in scope) - record some user-facing information concerning evaluation
As usage examples, a simple pure evaluator may use a plain map of Name
to
. A more complex type evaluator may allow "defaulting" for variables
not in scope via IMPLICIT rules.EvalTo
m
The associated type family EvalTo
enables using this for both type and value
evaluators.
Methods
lookupFVar :: Name -> m (Maybe (EvalTo m)) Source #
Request the value of a variable.
Returns Nothing
if the variable is not in scope.
warn :: String -> m () Source #
Record some user-facing information concerning evaluation.
For example, you may want to inform the user when you've made a defaulting decision.
Instances
MonadFEval FEvalValuePure Source # | |||||
Defined in Language.Fortran.Repr.Eval.Value Associated Types
Methods lookupFVar :: Name -> FEvalValuePure (Maybe (EvalTo FEvalValuePure)) Source # warn :: String -> FEvalValuePure () Source # |