RE: Anomalous Class Fundep Inference
There's a design space about how vigorous one is about checking for "unsatisfiable" instances when doing overlap things. It's quite a complicated design space that I don't fully understand, which is why GHC at least implements a conservative rule. For example, does one complain about overlap when the instance declarations are defined, or when they are used? Does one assume that new instances can be added "later"? and there is more I think. Simon | -----Original Message----- | From: Ashley Yakeley [mailto:ashley@semantic.org] | Sent: 05 May 2001 07:53 | To: Haskell List | Subject: RE: Anomalous Class Fundep Inference | | | At 2001-05-03 01:42, Simon Peyton-Jones wrote: | | >Quite right too! | | OK, I understand it a bit better now. This code does not compile: | -- | class X a | instance X Bool | instance (Num a) => X a | -- | Can someone explain why the two instances overlap, given that | Bool is not | an instance of Num? | | Would it be possible for Haskell to figure out this sort of | thing and not | complain about it, or would that lead to nasty problems? | | -- | Ashley Yakeley, Seattle WA | | | _______________________________________________ | Haskell mailing list | Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell |
participants (1)
-
Simon Peyton-Jones