
No, I don't think that would be adequate, but maybe there's a way to work
that in. It's inadequate because MINIMAL doesn't carry any assertion of
efficiency. If I indicate I want a class derived by GND, and it works, then
I expect its implementation to be, at worst, very very slightly slower than
the underlying implementation. If the class author doesn't make such a
claim, I want users to have to be explicit about the methods derived by GND.
On Jan 12, 2017 8:01 AM, "Reid Barton"
On Mon, Jan 9, 2017 at 5:11 PM, David Feuer
wrote: On Mon, Jan 9, 2017 at 1:32 PM, Richard Eisenberg
wrote: 2. Defaulting to the implementation written in the class (or `error "undefined method"` in the absence of a default. This is essentially the default default.)
I want to be able to specify that a certain default definition is good enough not to worry about.
Is this the same as the purpose of the MINIMAL pragma? http://ghc.readthedocs.io/en/latest/glasgow_exts.html#minimal-pragma
Imagine GND provides implementations for those methods whose types are amenable to `coerce`ion and leaves the other methods without definitions. Then, taking into account the MINIMAL pragma, GHC either does or does not produce a warning/error about missing class methods, maybe customized to mention the failure to `coerce` a method in GND. Would that be adequate?
Regards, Reid Barton