| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
AstEval
Synopsis
- evalAst :: [ScopeMb] -> Ast -> (Either String (Maybe Ast), [ScopeMb])
- evalBiValOp :: (Int -> Int -> Int) -> [ScopeMb] -> Ast -> (Either String (Maybe Ast), [ScopeMb])
- evalBiBoolOp :: (Bool -> Bool -> Bool) -> [ScopeMb] -> Ast -> (Either String (Maybe Ast), [ScopeMb])
- evalBiCompValOp :: (Int -> Int -> Bool) -> [ScopeMb] -> Ast -> (Either String (Maybe Ast), [ScopeMb])
Documentation
evalBiValOp :: (Int -> Int -> Int) -> [ScopeMb] -> Ast -> (Either String (Maybe Ast), [ScopeMb]) Source #
Evaluate the Ast for a given binary value operator
such as +, -, or *.
Takes a function that takes two Int and return one Int,
the stack as a '[ScopeMb]', and the Ast to evaluate.
Return a tuple containing the new stack post evaluation, and the
application of the function onto the values inside the given Ast
or a Ast containing the error message in case of error
evalBiBoolOp :: (Bool -> Bool -> Bool) -> [ScopeMb] -> Ast -> (Either String (Maybe Ast), [ScopeMb]) Source #
Evaluate the Ast for a given binary boolean operator
such as && or ||.
Takes a function that takes two Bool and return one Bool,
the stack as a '[ScopeMb]', and the Ast to evaluate.
Return a tuple containing the new stack post evaluation, and the
application of the function onto the booleans inside the given Ast
or a Ast containing the error message in case of error
evalBiCompValOp :: (Int -> Int -> Bool) -> [ScopeMb] -> Ast -> (Either String (Maybe Ast), [ScopeMb]) Source #
Evaluate the Ast for a given binary comparison operator
such as ==, >, or <=.
Takes a function that takes two Int and return one Bool,
the stack as a '[ScopeMb]', and the Ast to evaluate.
Return a tuple containing the new stack post evaluation, and the
application of the function onto the values inside the given Ast
or a Ast containing the error message in case of error