FWIW, I think I used &quot;o&quot; for &quot;output&quot;.  I&#39;d go with (-&gt;) i and (,) o .<br><br><div class="gmail_quote">On Fri, Sep 24, 2010 at 2:44 AM, Thomas Schilling <span dir="ltr">&lt;<a href="mailto:nominolo@googlemail.com">nominolo@googlemail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">+1<br>
<br>
I&#39;d also prefer the variable to be called &#39;w&#39; like for the writer<br>
Monad.  But that&#39;s a bikeshed, so I don&#39;t mind either way.<br>
<div><div></div><div class="h5"><br>
On 23 September 2010 16:58, Jake McArthur &lt;<a href="mailto:jake.mcarthur@gmail.com">jake.mcarthur@gmail.com</a>&gt; wrote:<br>
&gt; This proposal [1] was originally submitted to Trac by Conal Elliott, but it<br>
&gt; was apparently abandoned and closed after some time. I&#39;ve picked it back up<br>
&gt; and written out a patch. Here is the text of the proposal:<br>
&gt;<br>
&gt;&gt; I&#39;d like to have a (,)-style writer instance alongside the (-&gt;)-based<br>
&gt;&gt; reader instance for Monad in Control.Monad.Instances.<br>
&gt;&gt;<br>
&gt;&gt; Here&#39;s the current reader:<br>
&gt;&gt;<br>
&gt;&gt;    instance Monad ((-&gt;) r) where<br>
&gt;&gt;        return = const<br>
&gt;&gt;        f &gt;&gt;= k = \ r -&gt; k (f r) r<br>
&gt;&gt;<br>
&gt;&gt; and my proposed writer:<br>
&gt;&gt;<br>
&gt;&gt;    instance Monoid o =&gt; Monad ((,) o) where<br>
&gt;&gt;        return = pure<br>
&gt;&gt;        (o,a) &gt;&gt;= f = (o `mappend` o&#39;, a&#39;) where (o&#39;,a&#39;) = f a<br>
&gt;&gt;<br>
&gt;&gt; where the return definition relies on the Applicative instance of ((,) o).<br>
&gt;&gt; Written out explicitly,<br>
&gt;&gt;<br>
&gt;&gt;        return a = (mempty,a)<br>
&gt;&gt;<br>
&gt;&gt; Control.Monad.Instances will also need two new imports:<br>
&gt;&gt;<br>
&gt;&gt;    import Data.Monoid (Monoid(..))<br>
&gt;&gt;    import Control.Applicative (pure)<br>
&gt;<br>
&gt; - Jake<br>
&gt;<br>
&gt; [1] <a href="http://hackage.haskell.org/trac/ghc/ticket/1951" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/1951</a><br>
&gt; _______________________________________________<br>
&gt; Libraries mailing list<br>
&gt; <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
&gt;<br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Push the envelope. Watch it bend.<br>
</font><div><div></div><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br>