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
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
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
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
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