The head field of the Stack composes all associated metadata of the topmost element of the stack.
The head field of the Stack composes all associated metadata of the topmost element of the stack.
head
does not give access to the value T
, use make
instead.
Materialize the current stack with the given parameters,
producing a T
-typed value representing the current
configuration.
Produce a new stack representing the concatenation of this
with right
.
Produce a new stack representing the concatenation of this
with right
. Note that this replaces the terminating element of
this
.
A copy of this Stack with stk
prepended.
Produce a new stack representing the concatenation of this
with right
.
Produce a new stack representing the concatenation of this
with right
. Note that this replaces the terminating element of
this
.
Alias for Stack.++.
Returns whether the stack contains a given role or not.
Traverse the stack, until you find that pred has been evaluated to true.
Traverse the stack, until you find that pred has been evaluated to true.
If pred
finds an element, return true, otherwise, false.
Traverse the stack, invoking fn
on each element.
Traverse the stack, invoking fn
on each element.
Insert the given Stackable after the stack elements matching the argument role.
Insert the given Stackable after the stack elements matching
the argument role. If no elements match the role, then an
unmodified stack is returned. insertion
must conform to
typeclass CanStackFrom.
Insert the given Stackable after the stack elements matching the argument role.
Insert the given Stackable after the stack elements matching the argument role. If no elements match the role, then an unmodified stack is returned.
Insert the given Stackable before the stack elements matching the argument role.
Insert the given Stackable before the stack elements matching
the argument role. If no elements match the role, then an
unmodified stack is returned. insertion
must conform to
typeclass CanStackFrom.
Insert the given Stackable before the stack elements matching the argument role.
Insert the given Stackable before the stack elements matching the argument role. If no elements match the role, then an unmodified stack is returned.
A copy of this Stack with stk
prepended.
A copy of this Stack with stk
prepended.
An alias for Stack.+:.
Remove all nodes in the stack that match the target
role.
Remove all nodes in the stack that match the target
role.
Leaf nodes are not removable.
Replace any stack elements matching the argument role with a given Stackable.
Replace any stack elements matching the argument role with a
given Stackable. If no elements match the role, then an
unmodified stack is returned. replacement
must conform to
typeclass CanStackFrom.
Replace any stack elements matching the argument role with a given Stackable.
Replace any stack elements matching the argument role with a given Stackable. If no elements match the role, then an unmodified stack is returned.
Enumerate each well-formed stack contained within this stack.
Transform one stack to another by applying fn
on each element;
the map traverses on the element produced by fn
, not the
original stack.
Transform one stack to another by applying fn
on each element;
the map traverses on the element produced by fn
, not the
original stack.
Stacks represent stackable elements of type T. It is assumed that T-typed elements can be stacked in some meaningful way; examples are functions (function composition) Filters (chaining), and ServiceFactories (through transformers). T-typed values are also meant to compose: the stack itself materializes into a T-typed value.
Stacks are persistent, allowing for nondestructive transformations; they are designed to represent 'template' stacks which can be configured in various ways before materializing the stack itself.
Note: Stacks are advanced and sometimes subtle. For expert use only!