fortran-vars-0.4.0: Fortran memory model and other static analysis tools.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Fortran.Vars.Eval.FortranSrc

Description

fortran-vars-style expression evaluation which piggybacks off the evaluator in fortran-src.

Synopsis

Documentation

newtype Eval a Source #

Fortran expression evaluation monad, using SymbolTable and reporting fortran-src evaluator errors.

Constructors

Eval 

Fields

Instances

Instances details
Applicative Eval Source # 
Instance details

Defined in Language.Fortran.Vars.Eval.FortranSrc

Methods

pure :: a -> Eval a Source #

(<*>) :: Eval (a -> b) -> Eval a -> Eval b Source #

liftA2 :: (a -> b -> c) -> Eval a -> Eval b -> Eval c Source #

(*>) :: Eval a -> Eval b -> Eval b Source #

(<*) :: Eval a -> Eval b -> Eval a Source #

Functor Eval Source # 
Instance details

Defined in Language.Fortran.Vars.Eval.FortranSrc

Methods

fmap :: (a -> b) -> Eval a -> Eval b Source #

(<$) :: a -> Eval b -> Eval a Source #

Monad Eval Source # 
Instance details

Defined in Language.Fortran.Vars.Eval.FortranSrc

Methods

(>>=) :: Eval a -> (a -> Eval b) -> Eval b Source #

(>>) :: Eval a -> Eval b -> Eval b Source #

return :: a -> Eval a Source #

MonadFEval Eval Source #

Evaluate Fortran expressions to FValues.

We look up variables from a plain SymbolTable, but evaluate using fortran-src's machinery. We must therefore translate SymbolTable ExpVals to FValue. If we want to return fortran-vars-style types, we must translate the other way after executing a program in this monad.

Instance details

Defined in Language.Fortran.Vars.Eval.FortranSrc

Associated Types

type EvalTo Eval Source #

MonadError Error Eval Source # 
Instance details

Defined in Language.Fortran.Vars.Eval.FortranSrc

Methods

throwError :: Error -> Eval a Source #

catchError :: Eval a -> (Error -> Eval a) -> Eval a Source #

MonadReader SymbolTable Eval Source # 
Instance details

Defined in Language.Fortran.Vars.Eval.FortranSrc

type EvalTo Eval Source # 
Instance details

Defined in Language.Fortran.Vars.Eval.FortranSrc

type Eval' = ExceptT Error (Reader SymbolTable) Source #

Fortran expression evaluation monad, using SymbolTable and reporting fortran-src evaluator errors.

We use a newtype wrapper on this at Eval. The type synonym assists some boilerplate.

runEval :: SymbolTable -> Eval a -> Either Error a Source #

Execute a program in the Fortran expression evaluation monad Eval.