[Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated

John Lato jwlato at gmail.com
Tue Dec 3 05:43:55 UTC 2013


(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 <anthony_clayden at clear.net.nz> wrote:

> > Richard Eisenberg <eir <at> cis.upenn.edu> 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131202/9fcc3b31/attachment.html>


More information about the Haskell-Cafe mailing list