A stream is a (continuing) sequence of elements bundled in Chunks.
The first two variants indicate termination of the stream.
Chunk a gives the currently available part of the stream.
The stream is not terminated yet.
The case (null Chunk) signifies a stream with no currently available
data but which is still continuing. A stream processor should,
informally speaking, ``suspend itself'' and wait for more data
to arrive.

Iteratee -- a generic stream processor, what is being folded over
a stream
When Iteratee is in the done state, it contains the computed
result and the remaining part of the stream.
In the cont state, the iteratee has not finished the computation
and needs more input.
We assume that all iteratees are good -- given bounded input,
they do the bounded amount of computation and take the bounded amount
of resources. The monad m describes the sort of computations done
by the iteratee as it processes the stream. The monad m could be
the identity monad (for pure computations) or the IO monad
(to let the iteratee store the stream processing results as they
are computed).
We also assume that given a terminated stream, an iteratee
moves to the done state, so the results computed so far could be returned.

The type of the converter from the stream with elements el_outer
to the stream with element el_inner. The result is the iteratee
for the outer stream that uses an `IterateeG el_inner m a'
to process the embedded, inner stream as it reads the outer stream.

Each enumerator takes an iteratee and returns an iteratee
an Enumerator is an iteratee transformer.
The enumerator normally stops when the stream is terminated
or when the iteratee moves to the done state, whichever comes first.
When to stop is of course up to the enumerator...

The following is a variant of join in the IterateeGM s el m monad
When el' is the same as el, the type of joinI is indeed that of
true monadic join. However, joinI is subtly different: since
generally el' is different from el, it makes no sense to
continue using the internal, IterateeG el' m a: we no longer
have elements of the type el' to feed to that iteratee.
We thus send EOF to the internal Iteratee and propagate its result.
This join function is useful when dealing with `derived iteratees'
for embedded/nested streams. In particular, joinI is useful to
process the result of take, mapStream, or convStream below.

The analogue of List.break
It takes an element predicate and returns the (possibly empty) prefix of
the stream. None of the characters in the string satisfy the character
predicate.
If the stream is not terminated, the first character on the stream
satisfies the predicate.

Given a sequence of characters, attempt to match them against
the characters on the stream. Return the count of how many
characters matched. The matched characters are removed from the
stream.
For example, if the stream contains abd, then (heads abc)
will remove the characters ab and return 2.

Read n elements from a stream and apply the given iteratee to the
stream of the read elements. Unless the stream is terminated early, we
read exactly n elements (even if the iteratee has accepted fewer).

Read n elements from a stream and apply the given iteratee to the
stream of the read elements. If the given iteratee accepted fewer
elements, we stop.
This is the variation of take with the early termination
of processing of the outer stream once the processing of the inner stream
finished early.

Map the stream: yet another iteratee transformer
Given the stream of elements of the type el and the function el->el',
build a nested stream of elements of the type el' and apply the
given iteratee to it.
Note the contravariance

Convert one stream into another, not necessarily in lockstep
The transformer mapStream maps one element of the outer stream
to one element of the nested stream. The transformer below is more
general: it may take several elements of the outer stream to produce
one element of the inner stream, or the other way around.
The transformation from one stream to the other is specified as
IterateeGM s el m (Maybe (s' el')). The Maybe type is in case of
errors (or end of stream).