Narrower (per-method) GND

Reid Barton rwbarton at gmail.com
Thu Jan 12 13:01:21 UTC 2017


On Mon, Jan 9, 2017 at 5:11 PM, David Feuer <david.feuer at gmail.com> wrote:
> On Mon, Jan 9, 2017 at 1:32 PM, Richard Eisenberg <rae at cs.brynmawr.edu> 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


More information about the Glasgow-haskell-users mailing list