On Fri, Dec 25, 2009 at 8:31 PM, Felipe Lessa <span dir="ltr">&lt;<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br></div>
However you&#39;re right in a sense, you can&#39;t use this scheme to<br>
serialize any functions taking functions, like<br>
<br>
    something :: (a -&gt; Parser a) -&gt; a -&gt; Parser a<br>
<br>
because<br>
<br>
    data MyParser = FunSomething (a -&gt; MyParser) a<br>
<br>
wouldn&#39;t be serializable.  Well, maybe if your parsers were<br>
arrows... :)<br>
<br></blockquote><div><br></div><div>You can&#39;t use full arrows because you need to be able to lift an arbitrary function into an arrow type, which precludes meeting the serialization criterion. </div><div><br></div><div>
You CAN use a CCC, but they are a bit harder to work with. =)</div><div><br></div><div><a href="http://hackage.haskell.org/packages/archive/category-extras/0.53.5/doc/html/Control-Category-Cartesian-Closed.html">http://hackage.haskell.org/packages/archive/category-extras/0.53.5/doc/html/Control-Category-Cartesian-Closed.html</a></div>
<div><br></div><div>-Edward Kmett</div></div>