Re: Re[2]: [Haskell-cafe] XmlSerializer.deserialize?

2007-07-02 Thread Philip Armstrong
On Mon, Jul 02, 2007 at 12:23:36AM +0200, Hugh Perkins wrote: Clll :-) Thanks for the link. Er are you the Philip Armstrong I was at college with Shhh. Don't tell everyone or they'll all want one. (iow, yes: Probably.) Phil -- http://www.kantaka.co.uk/ .oOo. public key:

Re: Re[2]: [Haskell-cafe] XmlSerializer.deserialize?

2007-07-02 Thread Hugh Perkins
lol small world :-) On 7/2/07, Philip Armstrong [EMAIL PROTECTED] wrote: On Mon, Jul 02, 2007 at 12:23:36AM +0200, Hugh Perkins wrote: Clll :-) Thanks for the link. Er are you the Philip Armstrong I was at college with Shhh. Don't tell everyone or they'll all want one.

Re: [Haskell-cafe] XmlSerializer.deserialize?

2007-07-01 Thread Hugh Perkins
On 6/26/07, Udo Stenzel [EMAIL PROTECTED] wrote: That's another way of saying that the truly powerful features are missing from C#... Hi Udo, Genuine question: please could you tell me what are the truly powerful features of Haskell? My own personal interest comes from a presentation by

Re[2]: [Haskell-cafe] XmlSerializer.deserialize?

2007-07-01 Thread Bulat Ziganshin
Hello Hugh, Sunday, July 1, 2007, 8:56:05 PM, you wrote: Genuine question: please could you tell me what are the truly powerful features of Haskell? Anyway, getting back to my question, there's a whole slew of articles around saying that no-one uses Haskell because they're too stupid. 

Re: Re[2]: [Haskell-cafe] XmlSerializer.deserialize?

2007-07-01 Thread Hugh Perkins
Ok good info :-) btw, are you read Hoar's book Communicating Sequential Processes? i think that his model is very FPish and reading his book should allow to switch your look at concurrency in right direction No, I'll check it out. On 7/1/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello

Re: Re[2]: [Haskell-cafe] XmlSerializer.deserialize?

2007-07-01 Thread Hugh Perkins
Well, figured out a solution to parsing xml. It's not really pretty, but it works. Basically we just convert the incoming xml into a gread compatible format then use gread :-D If someone has a more elegant solution, please let me know. module ParseXml where import IO import Char import

Re: Re[2]: [Haskell-cafe] XmlSerializer.deserialize?

2007-07-01 Thread Philip Armstrong
On Sun, Jul 01, 2007 at 10:48:11PM +0200, Hugh Perkins wrote: On 7/1/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: btw, are you read Hoar's book Communicating Sequential Processes? i think that his model is very FPish and reading his book should allow to switch your look at

Re: Re[2]: [Haskell-cafe] XmlSerializer.deserialize?

2007-07-01 Thread Hugh Perkins
Clll :-) Thanks for the link. Er are you the Philip Armstrong I was at college with ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] XmlSerializer.deserialize?

2007-06-30 Thread Hugh Perkins
Still struggling with this. If anyone has any constructive ideas? I guess it's not really easy otherwise someone would have come up with a solution by now ;-) The issue is the line in makeConstrM'' where we're trying to read (Data a = a) from (String). read doesnt work, because read needs a

Re: [Haskell-cafe] XmlSerializer.deserialize?

2007-06-26 Thread Hugh Perkins
On 6/25/07, Udo Stenzel [EMAIL PROTECTED] wrote: That type signature describes a function that can deliver *anything* (that is in class Data), whatever you ask from it. Yes, that is the goal :-) If you do that, you wind up dragging in all the machinery of Data.Generic Is reflection

Re: [Haskell-cafe] XmlSerializer.deserialize?

2007-06-26 Thread Udo Stenzel
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?

[Haskell-cafe] XmlSerializer.deserialize?

2007-06-24 Thread Hugh Perkins
Hi, Trying to write a function to deserialize a haskell type from xml. Ideally this wont need a third DTD file, ie it will work something like XmlSerializer.Deserialize from C#: deserializeXml :: Data(a) = String - a serializeXml :: Data(a) = a - String Writing serializeXml is pretty easy:

Re: [Haskell-cafe] XmlSerializer.deserialize?

2007-06-24 Thread Andrea Vezzosi
As a side note i'd like to point out that introspectData has a problem with constructors containing Strings because show (x::String) /= x: data Foo = Foo { bar :: String } deriving (Typeable,Data) introspectData (Foo quux) -- [(bar,\quux\)] Those extras \ don't look very nice in the xml.. (the

Re: [Haskell-cafe] XmlSerializer.deserialize?

2007-06-24 Thread Hugh Perkins
Yes, or better: gshow' :: Data a = a - String gshow' t = fromMaybe (showConstr(toConstr t)) (cast t) (which gets rid of the parentheses around numbers). Still doesnt get a deserialize though ;-) On 6/24/07, Andrea Vezzosi [EMAIL PROTECTED] wrote: As a side note i'd like to point out that