fortran-src-0.15.1: Parsers and analyses for Fortran standards 66, 77, 90, 95 and 2003 (partial).
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Fortran.Repr.Eval.Common

Description

Common Fortran evaluation definitions.

Synopsis

Documentation

class Monad m => MonadFEval m 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 EvalTo m. A more complex type evaluator may allow "defaulting" for variables not in scope via IMPLICIT rules.

The associated type family EvalTo enables using this for both type and value evaluators.

Associated Types

type EvalTo m Source #

Target type that we evaluate to.

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

Instances details
MonadFEval FEvalValuePure Source # 
Instance details

Defined in Language.Fortran.Repr.Eval.Value

Associated Types

type EvalTo FEvalValuePure Source #