<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">From: <a href="mailto:dm-list-haskell-cafe@scs.stanford.edu">dm-list-haskell-cafe@scs.stanford.edu</a><br>

<br>
At Fri, 6 May 2011 10:10:26 -0300,<br>
Felipe Almeida Lessa wrote:<br>
<br>
&gt; So, in the enumerator vs. iterIO challenge, the only big differences I see are:<br>
&gt;<br>
&gt;  a) iterIO has a different exception handling mechanism.<br>
&gt;  b) iterIO can have pure iteratees that don&#39;t touch the monad.<br>
&gt;  c) iterIO&#39;s iteratees can send control messages to ther enumerators.<br>
&gt;  d) iterIO&#39;s enumerators are enumeratees, but enumerator&#39;s enumerators<br>
&gt; are simpler.<br>
&gt;  e) enumerator has fewer dependencies.<br>
&gt;  f) enumerator uses conventional nomenclature.<br>
&gt;  g) enumerator is Haskell 98, while iterIO needs many extensions (e.g.<br>
&gt; MPTC and functional dependencies).<br>
&gt;<br>
&gt; Anything that I missed?<br>
&gt;<br>
&gt; The bottomline: the biggest advantage I see right now in favor of<br>
&gt; iterIO is c),<br>
<br>
I basically agree with this list, but think you are underestimating<br>
the value of a.  I would rank a as the most important difference<br>
between the packages.  (a also is the reason for d.)<br></blockquote><div><br></div><div>&#39;a&#39; is important, but I think a lot of people underestimate the value of &#39;c&#39;, which is why a control system was implemented in &#39;iteratee&#39;.  I would argue that iteratee&#39;s control system is more powerful than you say.  For example, the only reason iteratee can&#39;t implement tell is because it doesn&#39;t keep track of the position in the stream, it&#39;s relatively simple for an enumerator to return data to an iteratee using an IORef for example.  And adding support to keep track of the stream position would be a pretty simple (and possibly desirable) change.  But it&#39;s definitely not as sophisticated as IterIO, and probably won&#39;t become so unless I have need of those features.</div>
<div><br></div><div>I like the MonadTrans implementation a lot.  The vast majority of iteratees are pure, and GHC typically produces more efficient code for pure functions, so this is possibly a performance win.  Although it makes something like the mutable-iter package very difficult to implement...</div>
<div><br></div><div>John Lato</div></div>