On Fri, Dec 25, 2009 at 05:12:22PM -0500, Antoine Latter wrote:
> In that case, You'll be able to serialize that as long as you can
> serialize (m a).
>
> I meant higher-order as in function-types. So you wouldn't be able to 
> serialize:
>
> string :: String -> Parser String
>
> Unless you had some way to reify the particular function to data.

That's the idea, to create something like

    data MyParser = FunString String
                  | ...

    interpret :: MyParser -> Parser String
    interpret (FunString str) = string str

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... :)

--
Felipe.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to