On Aug 3, 2011 1:33 PM, "Patrick Browne" <patrick.browne@dit.ie> wrote:
> instance Class Integer => SubClass Integer where
> moo a = foo a
Since you've just written the Class instance for Integer, the superclass context is actually irrelevant there. You may as well just write
instance SubClass Integer where
moo a = foo a
And that goes to the point of what the difference is. In the first case, you were declaring that all SubClass instances are Class instances,
and that mo defaults to foo for ALL types. In the latter case, you're defining this just for Integer. The difference is whether that default exists for other tyoes, or if its specific to Integer.
--
Chris Smith