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

Language.Fortran.Repr.Eval.Value

Description

Evaluate AST terms to values in the value representation.

Synopsis

Documentation

type MonadEvalValue m = (MonadEval m, EvalTo m ~ FValue, MonadError Error m) Source #

A convenience type over MonadEval bringing all requirements into scope.

data Error Source #

Value evaluation error.

Instances

Instances details
Generic Error Source # 
Instance details

Defined in Language.Fortran.Repr.Eval.Value

Associated Types

type Rep Error :: Type -> Type #

Methods

from :: Error -> Rep Error x #

to :: Rep Error x -> Error #

Show Error Source # 
Instance details

Defined in Language.Fortran.Repr.Eval.Value

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

MonadEval EvalValueSimple Source # 
Instance details

Defined in Language.Fortran.Repr.Eval.Value

Associated Types

type EvalTo EvalValueSimple Source #

Eq Error Source # 
Instance details

Defined in Language.Fortran.Repr.Eval.Value

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

type Rep Error Source # 
Instance details

Defined in Language.Fortran.Repr.Eval.Value

type EvalTo EvalValueSimple Source # 
Instance details

Defined in Language.Fortran.Repr.Eval.Value

type EvalValueSimple = WriterT [String] (ExceptT Error (Reader (Map Name FValue))) Source #

A simple pure interpreter for Fortran value evaluation programs.

err :: MonadError Error m => Error -> m a Source #

wrapSOp :: MonadEvalValue m => Either Error FScalarValue -> m FValue Source #

Wrap the output of an operation that returns a scalar value into the main evaluator.

evalBOp :: MonadEvalValue m => BinaryOp -> FValue -> FValue -> m FValue Source #

Evaluate explicit binary operators (ones denoted as such in the AST).

Note that this does not cover all binary operators -- there are many intrinsics which use function syntax, but are otherwise binary operators.

forceUnconsArg :: MonadEvalValue m => [a] -> m (a, [a]) Source #

forceArgs :: MonadEvalValue m => Int -> [a] -> m [a] Source #