| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Registry.Internal.Stack
Description
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
execStackWithValues :: Values -> Stack a -> Either Text Values #
Return the state of the stack after executing the action This returns the list of built values
evalStack :: Stack a -> Either Text Statistics #
Return the list of applied functions after resolution
evalStackWithValues :: Values -> Stack a -> Either Text Statistics #
getOperations :: Stack Operations #
Get the current list of operations
modifyValues :: (Values -> Values) -> Stack () #
Modify the current list of values
modifyOperations :: (Operations -> Operations) -> Stack () #
modifyStatistics :: (Statistics -> Statistics) -> Stack () #
functionApplied :: Value -> [Value] -> Stack () #
Store a function application in the list of operations