Superclass defaults
Max Bolingbroke
batterseapower at hotmail.com
Mon Aug 22 10:05:10 CEST 2011
On 21 August 2011 21:03, Alexey Khudyakov <alexey.skladnoy at gmail.com> wrote:
> I don't completely understant how does it work. Does client need to enable
> language extension to get default instances?
I think that the extension would only be required to *define them*,
not for them to be generated. The more conservative choice would
indeed be to require the extension for both, though.
> Also proposal cannot fix Functor/Applicative/Monad problem without breaking
> client code. It requires explicit opt-out but client may define Applicative
> instance. And unless "hiding" is added it will result in compile error.
I think the intention (at least as I understand it) is that a
superclass default is only used to generate an instance if there is
not already some suitable instance in scope, just like a default
method is only used if there is not some explicit definition for the
method in the instance. So the "hiding" mechanism would only be
required to work around tricky edge cases with orphan instances.
Max
More information about the Glasgow-haskell-users
mailing list