A generator is a consumer-driven source of data. Unlike Async streams, these
* objects are stateful. For example, if one generator is shared between two clients
* that both invoke next
, then they will see different sequences of items
singleton x
creates a generator containing only x.
find gen ~f
finds the first item for which f item
is true.
f item
is true,
or None if no such element is found.
Generates all elements from generator and returns the resulting list.
map' t f
creates a new generator that with the result of the deferred (f v),
for each element v of t.