[Haskell-cafe] understanding enumerator/iteratee

Jason Dusek jason.dusek at gmail.com
Sat Dec 20 04:11:31 EST 2008


  So, it looks Iteratee takes a "step" on the resource --
  whatever it is -- and Enumerator manages the resource and
  sequences the steps of the Iteratee. The Enumerator, then,
  defines our way of managing a particular resource -- how to
  take a step, how to close it, &c. -- while the Iteratee
  describes a computation that computes an output and also tells
  us when to free the resource.

  Is that a correct interpretation? I find the material on
  Enumerator and Iterator to be vague (or at least not very
  concrete).

  I have seen code for a random access Iteratee/Enumerator pair,
  as well. In that case, the role of the Iteratee is to provide
  the "next step" to take -- one of forward <n>, backward <n>,
  close?

--
_jsn


More information about the Haskell-Cafe mailing list