On Fri, Dec 25, 2009 at 8:31 PM, Felipe Lessa <felipe.lessa@gmail.com> wrote:

However you're right in a sense, you can't use this scheme to
serialize any functions taking functions, like

   something :: (a -> Parser a) -> a -> Parser a

because

   data MyParser = FunSomething (a -> MyParser) a

wouldn't be serializable.  Well, maybe if your parsers were
arrows... :)


You can'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. 

You CAN use a CCC, but they are a bit harder to work with. =)

http://hackage.haskell.org/packages/archive/category-extras/0.53.5/doc/html/Control-Category-Cartesian-Closed.html

-Edward Kmett