Re: [Haskell-cafe] derivable type classes

2010-03-24 Thread Ozgur Akgun
Thanks for the pointers again - you are of great help every time! On 23 March 2010 17:44, Josef Svenningsson josef.svennings...@gmail.comwrote: On Tue, Mar 23, 2010 at 11:52 AM, Ozgur Akgun ozgurak...@gmail.com wrote: Can a user define a derivable type class of her own? If yes, how? GHC

[Haskell-cafe] derivable type classes

2010-03-23 Thread Ozgur Akgun
Can a user define a derivable type class of her own? If yes, how? Cheers, -- Ozgur Akgun ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] derivable type classes

2010-03-23 Thread Ivan Lazar Miljenovic
Ozgur Akgun ozgurak...@gmail.com writes: Can a user define a derivable type class of her own? No. The derivable classes are defined in the Haskell Report; GHC does allow some others to be derived with extensions however. There is one exception to this: using the GeneralizedNewtypeDeriving

Re: [Haskell-cafe] derivable type classes

2010-03-23 Thread Chris Eidhof
No. A solution for this (depending on the type class you want to derive) is Generic Programming. Using Generic Programming, you can define functions that work on the structure of the type. For example, take a look at the regular package [1]. It provides all the functionality to write your own

Re: [Haskell-cafe] derivable type classes

2010-03-23 Thread Josef Svenningsson
On Tue, Mar 23, 2010 at 11:52 AM, Ozgur Akgun ozgurak...@gmail.com wrote: Can a user define a derivable type class of her own? If yes, how? GHC has a feature which lets you define classes such that making an instance of them is as easy as deriving. It's called Generic classes. See GHC's