
23 Mar
2010
23 Mar
'10
7:05 a.m.
Ozgur Akgun
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 extension, if type Foo instantiates a typeclass Baz, then you can derive Baz for newtype Bar = Bar Foo. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com