Wed Jul 5 15:58:59 EDT 2017

6 Iteration structures

Some representations of sequences.


- fold.erl   : left fold
- pfold.erl  : left fold with early stop

- source.erl : inner iterator (stream)
- iseq.erl   : infinite sequences (almost special case of source.erl)

- sink.erl   : sink-parameterized generator

- igen.erl   : impure generators

- unfold.erl : pure sequences represented as (finite) unfolds

The difference is in which operations are explicit:

fold,pfold:  functional write (state update)
source,iseq: functional read
unfold:      functional read with explicit state
sink:        imperative write (abstract function or process send)
igen:        imperative read

Since these are a nice orthogonal mix of classes, a there might be a
more appropriate naming scheme.

These are duals in the caller/callee sense.

For the functional ones there are finite/infinite vs full/truncate.

(EDIT: this was editited to add unfold.erl)