[Haskell-cafe] XmlSerializer.deserialize?

Udo Stenzel u.stenzel at web.de
Tue Jun 26 17:38:21 EDT 2007

Hugh Perkins wrote:
> Is reflection hard in Haskell?  In C# its easy, and its one of the most
> powerful features of C#

That's another way of saying that the truly powerful features are
missing from C#...

> Yes, but I'm kindof stuck giving useful input to makeConstrM, so if
> anyone has any ideas?

You mean makeConstr?  Well, you don't call that at all.  But you do call
fromConstrM, and if you don't have suitable input for that, that's when
you realizie that you should have written the constructor name or index
when serializing.

> runM' :: (MonadState [String] m, Monad m, Data a) => m a
> runM' = do
>    value <- gets head
>    modify tail
>    -- then one of: (pick the non-working function of your choice ;-)  :
>    -- return read (fromJust value)
>    -- return (fromJust $ cast value )
>    -- return (fst $ head $ gread( "(" ++ value ++ ")" ) )
>    -- return (fromConstrM runM' constr)
>    -- return (fromConstr contr)

Of course not.  Wild guesswork will get you nowhere, instead you should
read the second SYB paper at http://homepages.cwi.nl/~ralf/syb2/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070626/9b39fc42/attachment.bin

More information about the Haskell-Cafe mailing list