
20 Dec
2008
20 Dec
'08
4:11 a.m.
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