Meeseeks v0.11.0 Meeseeks.Accumulator behaviour View Source
Accumulator structs package some means of storing nodes selected during the selection process along with a method for checking if the selection should be terminated early and a method for returning the stored nodes.
Users will not typically need to define, or even know about, accumulators, but for users trying to do things like return selected nodes as Document nodes (or even tuple-tree nodes) instead of as Results, a custom accumulator will provide the solution.
Link to this section Summary
Functions
Provided a document and a node id, returns an updated accumulator
Checks if an accumulator has reached an arbitrary state of completion and no longer wishes to be added to
Returns the values accumulated by the accumulator
Callbacks
Invoked to add a selected node to the accumulator
Invoked to determine if the accumulator is satisfied
Invoked to return the accumulation
Link to this section Types
t()
View Source
t() :: struct()
t() :: struct()
Link to this section Functions
add(accumulator, document, id)
View Source
add(t(), Meeseeks.Document.t(), Meeseeks.Document.node_id()) :: t()
add(t(), Meeseeks.Document.t(), Meeseeks.Document.node_id()) :: t()
Provided a document and a node id, returns an updated accumulator.
complete?(accumulator) View Source
Checks if an accumulator has reached an arbitrary state of completion and no longer wishes to be added to.
return(accumulator) View Source
Returns the values accumulated by the accumulator.
Link to this section Callbacks
add(accumulator, document, id)
View Source
add(
accumulator :: t(),
document :: Meeseeks.Document.t(),
id :: Meeseeks.Document.node_id()
) :: t()
add( accumulator :: t(), document :: Meeseeks.Document.t(), id :: Meeseeks.Document.node_id() ) :: t()
Invoked to add a selected node to the accumulator.
complete?(accumulator) View Source
Invoked to determine if the accumulator is satisfied.
return(accumulator) View Source
Invoked to return the accumulation.