registry-0.6.0.0: data structure for assembling components
Safe HaskellSafe-Inferred
LanguageGHC2021

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 Statistics (Either Text) a Source #

Monadic stack for the resolution algorithm

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

Return a value from the Stack if possible

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

Return a value from the Stack if possible

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

Run the stack to get a list of created values

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 #

Run the stack to get a the statistics, starting with some initially created values

getValues :: Stack Values Source #

Get the current list of values

getOperations :: 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 #

Modify the current operations

modifyStatistics :: (Statistics -> Statistics) -> Stack () Source #

Modify the current statistics

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

Store a function application in the list of operations