Narrower (per-method) GND

David Feuer david.feuer at gmail.com
Thu Jan 12 14:41:47 UTC 2017


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" <rwbarton at gmail.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20170112/4481a8f8/attachment.html>


More information about the Glasgow-haskell-users mailing list