Re: [Haskell-cafe] Helper classes for Generics

2012-03-12 Thread José Pedro Magalhães
It could, yes. Actually, using DefaultSignatures you can probably use SYB for defining classes with generic default methods, by adding Data and Typeable constraints instead of Generic. Cheers, Pedro 2012/3/12 Yves Parès > Thanks for the clarification. > But could not class Data have been used

Re: [Haskell-cafe] Helper classes for Generics

2012-03-12 Thread Yves Parès
Thanks for the clarification. But could not class Data have been used for generic Deriving of classes? I imagine it would have been harder, but I fail to see if would have been possible... Le 12 mars 2012 16:58, José Pedro Magalhães a écrit : > Hi Yves, > > GHC.Generics [1] and SYB [2] are two r

Re: [Haskell-cafe] Helper classes for Generics

2012-03-12 Thread José Pedro Magalhães
Hi Yves, GHC.Generics [1] and SYB [2] are two rather different approaches to generic programming. There are things that can be done in one but not in the other, and there are things that are easier on one rather than the other. For instance, SYB tends to be very useful for large AST transformation

Re: [Haskell-cafe] Helper classes for Generics

2012-03-12 Thread Yves Parès
I'd have a question concerning GHC.Generics: how does it relate to SYB's Data.Generics? Is it intended to replace it or complete it? In other words: does class Data.Generics.Data class do things that class GHC.Generics.Generic can't do? Le 12 mars 2012 04:27, Reiner Pope a écrit : > Hi all, > >

Re: [Haskell-cafe] Helper classes for Generics

2012-03-11 Thread José Pedro Magalhães
Hi Reiner, It is indeed not strictly necessary to define such helper classes for kind * generic functions. You do need them for kind * -> * functions, though. Also, I think they should always be used because they help keep things separate. If we use an implementation of generics with DataKinds [1]

[Haskell-cafe] Helper classes for Generics

2012-03-11 Thread Reiner Pope
Hi all, I've been playing with GHC's new generics features (see http://www.haskell.org/ghc/docs/latest/html/users_guide/generic-programming.html). All the documentation I've seen suggests creating a "helper class" -- for instance, the GSerialize class in the above link -- on which one defines