default roles

Richard Eisenberg eir
Fri Oct 11 01:52:01 UTC 2013


On Oct 10, 2013, at 1:14 PM, David Menendez wrote:
> Sure, but if op uses show internally, we get Int's show, not Age's, right? That seems correct, in that it's doing what GND is supposed to do, but I'll bet it will surprise people.

Yes, you're right. If a method in a subclass uses a superclass method, it uses the base type's instance's method, not the newtype's. Very weird, but I guess it makes sense in its own way. This does show how GND can create instance incoherence even without storing dictionaries in datatypes.

Richard




More information about the Glasgow-haskell-users mailing list