If anything there is already too much in the MonadWriter class, &#39;pass&#39; and &#39;listen&#39; actively get in the way of logically valid instances.  i.e. one that just logged its output out to a filestream using IO. The current MonadWriter prevents the existence of an instance for ContT r Writer as well.<div>
<div><br></div><div>I&#39;m hesitant to add more responsibility to MonadWriter. In this, I think MonadLib gets it right; if necessary, &#39;pass&#39; and &#39;listen&#39; could then be foisted off on another class. Sadly, it is not really an option to split MonadWriter in the MTL at this late date.</div>
<div><br></div><div>However, for consistency, I agree with you. If they must be present, it would at least be nice if you could get them to give consistent results. ;)</div><div><br></div><div>-Edward Kmett</div><div><br>
</div><div><div><div class="gmail_quote">On Fri, Mar 12, 2010 at 8:00 PM, Nicolas Frisby <span dir="ltr">&lt;<a href="mailto:nicolas.frisby@gmail.com">nicolas.frisby@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
*&gt; runWriter . runErrorT $ censor (filter (/=3)) $ tell [1,2,3] &gt;&gt; throwError &quot;&quot;<br>
(Left &quot;&quot;,[1,2,3])<br>
<br>
<br>
That&#39;s kind of weird, right? I understand why it is that way. I think<br>
this is reason enough to make censor part of the class, since it<br>
wouldn&#39;t have this short-coming if it weren&#39;t defined in terms of<br>
pass.<br>
<br>
*&gt; let censorErrorT f (ErrorT m) = ErrorT (censor f m)<br>
*&gt; runWriter . runErrorT $ censorErrorT (filter (/=3)) $ tell [1,2,3]<br>
&gt;&gt; throwError &quot;&quot;<br>
(Left &quot;&quot;,[1,2])<br>
<br>
Or is it preferable for censor and pass to misbehave in the same way?<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</blockquote></div><br></div></div></div>