registry-0.1.2.2: data structure for assembling components

Safe HaskellNone
LanguageHaskell2010

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

Documentation

type Stack a = StateT (Values, Operations) (Either Text) a Source #

Monadic stack for the resolution algorithm

runStack :: Stack a -> Values -> Either Text a Source #

Return a value from the Stack if possible

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

getValues :: Stack Values Source #

Get the current list of values

getOperation :: Stack Operations Source #

Get the current list of operations

modifyValues :: (Values -> Values) -> Stack () Source #

Modify the current list of values

modifyOperations :: (Operations -> Operations) -> Stack () Source #

Get the current list of values

functionApplied :: Value -> [Value] -> Stack () Source #

Store a function application in the list of operations