[Haskell-cafe] Supplying a default implementation for a typeclass
based on another class
Svein Ove Aas
svein.ove at aas.no
Sat Feb 28 08:28:25 EST 2009
2009/2/28 Lennart Augustsson <lennart at augustsson.net>:
> If you were writing your own Binary class you could simply make Show
> and Read superclasses of Binary and it would be trivial to have
> default implementations based on Show and Read.
That's my fallback approach, yes, but I don't really want to make
Binary a subclass of Show,Read. I'd like to be able to define this for
classes in packages I *don't* control, and without *requiring* the
fallback to work..
As you say, it isn't exactly a critical issue. I was just wondering if
it was possible, really.
More information about the Haskell-Cafe