Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal monad for the resolution algorithm
- we keep some state for the list of created values
- we collect the applied functions as Operations
- we might exit with a Left value if we can't build a value
Synopsis
- type Stack a = StateT (Values, Operations) (Either Text) a
- runStack :: Stack a -> Values -> Either Text a
- execStack :: Stack a -> Values -> Either Text Values
- evalStack :: Stack a -> Values -> Either Text Operations
- getValues :: Stack Values
- getOperation :: Stack Operations
- modifyValues :: (Values -> Values) -> Stack ()
- modifyOperations :: (Operations -> Operations) -> Stack ()
- functionApplied :: Value -> [Value] -> Stack ()
Documentation
type Stack a = StateT (Values, Operations) (Either Text) a Source #
Monadic stack for the resolution algorithm
execStack :: Stack a -> Values -> Either Text Values Source #
Return the state of the stack after executing the action This returns the list of built values
evalStack :: Stack a -> Values -> Either Text Operations Source #
Return the list of applied functions after resolution
getOperation :: Stack Operations Source #
Get the current list of operations
modifyOperations :: (Operations -> Operations) -> Stack () Source #
Get the current list of values