[<<][compsci][>>][..]
Wed Jul 5 15:33:04 EDT 2017

The most general I/O processor?

For the tokenizer, what works was:
- input as an outer iterator
- output as a left fold


How to turn an inner iterator into a fold?  You can't because the
control flow of the fold is one-shot.  The way to do this is to block
the fold when it's running, and that needs a task.

Look at fold:gen(), it would be similar.

EDIT: Works, but...

Converting fold into source is a leaky abstraction.  This popped up
only when writing parsers.  I wonder if it makes sense to then turn
the parser into a source, as sources are easy to convert to folds.

Doesn't seem so.  A parser is naturally written with individual
(blocking) read/write calls.  (Fold is write, while inner iterators
are read).






[Reply][About]
[<<][compsci][>>][..]