[<<][staapl][>>][..]
Mon Jun 23 11:08:51 CEST 2008

enumerators vs. cursors

http://okmij.org/ftp/Computation/Continuations.html#enumerator-stream
http://okmij.org/ftp/papers/LL3-collections-talk.pdf
http://okmij.org/ftp/Scheme/enumerators-callcc.html
http://lambda-the-ultimate.org/node/1882

Oleg makes a case for providing enumerators natively, and deriving
cursors from them if necessary, since they are the less useful
variant.

stream:     encapsulated iteration state
enumerator: collection fold

Comprehensions are similar to enumerators, but they do not iterate
over an abstracted datastructure, but over a concrete (sum/product) of
(possible abstract) data structures. They are trivially translated to
a map/fold HOF + fold function + a data constructor.

http://srfi.schemers.org/srfi-42/srfi-42.html
According to Sebastian Egner the main reason for this srfi is a simple
form for the naturals.

I find the middle way: using 'in-generator' from tools/seq.ss to
convert generators based on delimited control to sequences usable in
comprehensions quite convenient.



[Reply][About]
[<<][staapl][>>][..]