Narrower (per-method) GND

David Feuer david.feuer at gmail.com
Mon Jan 9 22:22:56 UTC 2017


On Mon, Jan 9, 2017 at 1:32 PM, Richard Eisenberg <rae at cs.brynmawr.edu> wrote:
> I agree with David that using explicit `coerce`s can be quite verbose and
> may need ScopedTypeVariables and InstanceSigs. But visible type application
> should always work, because class methods always have a fixed type argument
> order.

Oh, I missed this bit. That claim is not quite true. I could have something like

class Two f where
  two :: (Integral a, Num b) => proxy (f a b) -> String

Unless the package defining this class promises not to, its maintainer
could later change that to

  two :: forall b a proxy . (Integral a, Num b) => proxy (f a b) -> String

which could silently break code. Or change the position of the proxy
argument and loudly break code.


More information about the Glasgow-haskell-users mailing list