<div dir="ltr">From what you&#39;ve said, it sounds like you can already write:<div><br></div><div>    serverSide :: IO a -&gt; Form a</div><div><br></div><div>This seems elegant enough to me for your needs. Just encourage it as an idiom specific to Forms.</div>

<div><br></div><div>    myBlogForm = Blog &lt;$&gt; titleForm &lt;*&gt; serverSide getCurrentTime &lt;*&gt; contentsForm</div><div><br></div><div>Could you abstract `serverSide` out into a typeclass, such as ApplicativeIO? Sure. but why bother? The point is, you&#39;ve got the specialization you need already.</div>

</div><div class="gmail_extra"><br clear="all"><div>-- Dan Burton</div>
<br><br><div class="gmail_quote">On Tue, Oct 1, 2013 at 1:20 AM, Tom Ellis <span dir="ltr">&lt;<a href="mailto:tom-lists-haskell-cafe-2013@jaguarpaw.co.uk" target="_blank">tom-lists-haskell-cafe-2013@jaguarpaw.co.uk</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Oct 01, 2013 at 09:29:00AM +0200, Niklas Haas wrote:<br>
</div><div class="im">&gt; On Tue, 1 Oct 2013 02:21:13 -0500, John Lato &lt;<a href="mailto:jwlato@gmail.com">jwlato@gmail.com</a>&gt; wrote:<br>
&gt; &gt; It&#39;s not a solution per se, but it seems to me that there&#39;s no need for the<br>
&gt; &gt; Monad superclass constraint on MonadIO.  If that were removed, we could<br>
&gt; &gt; just have<br>
&gt; &gt;<br>
&gt; &gt; class LiftIO t where<br>
&gt; &gt;     liftIO :: IO a -&gt; t a<br>
&gt; &gt;<br>
&gt; &gt; and it would Just Work.<br>
&gt;<br>
&gt; One concern with this is that it&#39;s not exactly clear what the semantics<br>
&gt; are on LiftIO (is liftIO a &gt;&gt; liftIO b equal to liftIO (a &gt;&gt; b) or not?)<br>
&gt; and the interaction between LiftIO and Applicative/Monad would have to<br>
&gt; be some sort of ugly ad-hoc law like we have with Bounded/Enum etc.<br>
<br>
</div>Shouldn&#39;t it be an *Applicative* constraint?<br>
<br>
    class Applicative t =&gt; ApplicativeIO t where<br>
<div class="im">        liftIO :: IO a -&gt; t a<br>
<br>
</div>and require that<br>
<br>
    liftIO (pure x) = pure x<br>
    liftIO (f &lt;*&gt; x) = liftIO f &lt;*&gt; liftIO x<br>
<br>
Seems like ApplicativeIO makes more sense than MonadIO, which is<br>
unnecessarily restrictive.  With planned Functor/Applicative/Monad shuffle,<br>
the former could completely replace the latter.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tom<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>