Iterator for a Chain[A].
Iterator for a Chain[A].
This is where the magic happens. To efficiently traverse into Chain.Concat instances, we build our own stack on the heap. When we descend into the LHS of a Concat we push the RHS onto this stack, so that when we exhaust the LHS we will remember to get an iterator from the RHS too.
As mentioned earlier, iterating over ChainIterator[A] is an O(n) operation, that also consumes O(n) heap (the previously-mentioned stack.)
Wrapper for Chain[A] that provides Iterable[A].
Concatenate many collections together as a Chain.
Wrap a collection in a Chain[A].
scala.math.Ordering instance for Chains.
Produce an empty Chain[A].
Wrap a single A value in a Chain[A].