Re: [Haskell] XML Serialization and type constraints

2004-08-26 Thread Simon D. Foster
On Thu, 2004-08-26 at 09:47, MR K P SCHUPKE wrote: > You can do it using overlapping instances... > > data A > data B b > data C c > > instance Encode A where ... > > instance Encode b => Encode (B b) where > > instance Encode c => Encode (C c) where > > Keean. I don't understand what y

Re: [Haskell] XML Serialization and type constraints

2004-08-26 Thread MR K P SCHUPKE
You can do it using overlapping instances... data A data B b data C c instance Encode A where ... instance Encode b => Encode (B b) where instance Encode c => Encode (C c) where Keean. ___ Haskell mailing list [EMAIL PROTECTED] http://www.has

Re: [Haskell] XML Serialization and type constraints

2004-08-25 Thread Tomasz Zielonka
On Wed, Aug 25, 2004 at 08:38:51PM +0100, Simon D. Foster wrote: > Ok then, well it looks like this method is going to very cumbersome to > use; for example a context for a reasonably simple complex data-type > would be; > > (Hook Element t, Hook Bool t, Hook [ERS] t, Hook (Selection ERS) t, Hook

Re: [Haskell] XML Serialization and type constraints

2004-08-25 Thread Simon D. Foster
On Wed, 2004-08-25 at 16:19, Tomasz Zielonka wrote: > > > > Is there anyway of getting around this? > > Perhaps you could just 'encode Id' that parts? > > Best regards, > Tom Ok then, well it looks like this method is going to very cumbersome to use; for example a context for a reasonably simpl

Re: [Haskell] XML Serialization and type constraints

2004-08-25 Thread Tomasz Zielonka
On Wed, Aug 25, 2004 at 04:14:48PM +0100, Simon D. Foster wrote: > I think I jumped the gun it a bit; it almost works, but when I try to > declare a serializer for a type with several parts e.g. > > data Person = Person PackedString PackedString Int > > instance (Hook Person t) => Serializer Pers

Re: [Haskell] XML Serialization and type constraints

2004-08-25 Thread Simon D. Foster
On Wed, 2004-08-25 at 14:00, Tomasz Zielonka wrote: > On Wed, Aug 25, 2004 at 01:54:08PM +0100, Simon D. Foster wrote: > > On Wed, 2004-08-25 at 08:39, Tomasz Zielonka wrote: > > - snip - > > > > > I hope that helps, > > > > > > Best regards, > > > Tom > > > > That method works perfectly! Thank

Re: [Haskell] XML Serialization and type constraints

2004-08-25 Thread Tomasz Zielonka
On Wed, Aug 25, 2004 at 01:54:08PM +0100, Simon D. Foster wrote: > On Wed, 2004-08-25 at 08:39, Tomasz Zielonka wrote: > - snip - > > > I hope that helps, > > > > Best regards, > > Tom > > That method works perfectly! Thank you so much! I assume there is no way > of achieving this without overla

Re: [Haskell] XML Serialization and type constraints

2004-08-25 Thread Simon D. Foster
On Wed, 2004-08-25 at 08:39, Tomasz Zielonka wrote: - snip - > I hope that helps, > > Best regards, > Tom That method works perfectly! Thank you so much! I assume there is no way of achieving this without overlapping instances? Thanks, -Si. -- Simon D. Foster <[EMAIL PROTECTED]> Sheffield Un

Re: [Haskell] XML Serialization and type constraints

2004-08-25 Thread Tomasz Zielonka
On Tue, Aug 24, 2004 at 07:35:46PM +0100, Simon D. Foster wrote: > I'm trying to implement an extensible XML De/Serializer in Haskell for > use with SOAP and XML Schema (using the Haskell XML Toolbox). The idea > is you have a type-class, which is instantiated for each type you want > to encode/de-

[Haskell] XML Serialization and type constraints

2004-08-24 Thread Simon D. Foster
I'm trying to implement an extensible XML De/Serializer in Haskell for use with SOAP and XML Schema (using the Haskell XML Toolbox). The idea is you have a type-class, which is instantiated for each type you want to encode/de-encode. This class (atm) takes the form; class XMLSerializer a where