[Haskell-cafe] Constructing a datatype given just its constructor as a string?

Hugh Perkins hughperkins at gmail.com
Sun Jun 24 08:20:54 EDT 2007

Trying to create a datatype/constructor given just its constructor as a
string, something like:

mkConstr :: String -> Constr
parseData :: (Data a) => String -> a

***without knowing in advance anything about the datatype apart from the
string contents***

So, not something like:

parseData "Just 3" :: [Maybe]

but simply:

parseData "Just 3"

(This is linked to the other post: the goal is to be able to deserialize xml
without needing to know in advance the data type we are deserializing)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070624/be4f193e/attachment.htm

More information about the Haskell-Cafe mailing list