
5 Sep
2009
5 Sep
'09
12:45 p.m.
Am Samstag 05 September 2009 09:53:34 schrieb Chaddaï Fouché:
On Fri, Sep 4, 2009 at 2:57 PM, Daniel Fischer
wrote: In general: not. The problem is that potentially every datatype can be made an instance of the class, so in the default implementations, you can only[*] use functions which work on every datatype. There aren't many interesting functions that do.
[*]well, you can also use methods of the class and superclasses.
And so by using Data and Typeable as superclasses, he could do what he is asking for... And Data and Typeable are automatically derivables by GHC (extension).
True. But I don't think the code would become any shorter/better/easier to maintain (*shudder*), so I'd stick to individual instance declarations.