
(a bit late to the discussion, so please ignore if this is completely
off-base)
On Mon, Dec 2, 2013 at 9:17 PM, AntC
Richard Eisenberg
writes: - The notion of "competing instances" for type families sounds somewhat like delayed overlap checks for class instances. ...
No. No delay. The point is to validate eagerly at the point of declaring the instance (and whether or not it's in some other module). The guards guarantee that no instances overlap. Importing an overlapping instance is trapped immediately; no risk of incoherence.
How can this possibly work with open type families? What happens in this case?
module A where type instance F a b c | b /~ c = Int
module B where type instance F a b c | a /~ c = Bool
During compilation, neither A nor B is aware of the other. What happens in a module that imports both?