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 Statistics (Either Text) a
- runStack :: Stack a -> Either Text a
- runStackWithValues :: Values -> Stack a -> Either Text a
- execStack :: Stack a -> Either Text Values
- execStackWithValues :: Values -> Stack a -> Either Text Values
- evalStack :: Stack a -> Either Text Statistics
- evalStackWithValues :: Values -> Stack a -> Either Text Statistics
- getValues :: Stack Values
- getOperations :: Stack Operations
- modifyValues :: (Values -> Values) -> Stack ()
- modifyOperations :: (Operations -> Operations) -> Stack ()
- modifyStatistics :: (Statistics -> Statistics) -> Stack ()
- functionApplied :: Value -> [Value] -> Stack ()
Documentation
runStackWithValues :: Values -> Stack a -> Either Text a Source #
Return a value from the Stack if possible
execStackWithValues :: Values -> Stack a -> Either Text Values Source #
Return the state of the stack after executing the action This returns the list of built values
evalStack :: Stack a -> Either Text Statistics Source #
Return the list of applied functions after resolution
evalStackWithValues :: Values -> Stack a -> Either Text Statistics Source #
getOperations :: Stack Operations Source #
Get the current list of operations
modifyOperations :: (Operations -> Operations) -> Stack () Source #
modifyStatistics :: (Statistics -> Statistics) -> Stack () Source #