> "A type may not be declared as an instance of a particular class more than > once in the program." > > Doesn't it really mean that a type _constructor_ may not appear in more > than one instance declaration for a particular class? That (stronger) > condition seems to be what ghc and hugs implement, and probably makes more > sense, given the rationale of the overlapping instance rule in the first > place. Yes, that's right. In Std Haskell, though, the situation is likely to be that "two instance decls may not overlap", where "overlap" means that the two instance heads are unifiable. The instance head is the bit after the "=>". > Specifically, I'm thinking of situations such as: > > instance A a => C [a] > > instance B a => C [a] Here the instance heads overlap. The fact that A and B are different is neither here nor there. (One could imagine allowing overlapping inst decls where the type was an instance of only one of A or B, but that's quite a bit more complicated.) Simon
