[Haskell-cafe] Equality constraints in type families

Simon Peyton-Jones simonpj at microsoft.com
Wed Mar 26 07:44:33 EDT 2008

| > Why not quite?
| Maybe I was thinking too much in terms of GHC's implementation, but
| due to the lazy expansion type synonyms, the expansion is interleaved
| with all the rest of type checking.  But I think I now know what you
| meant: the outcome should be *as if* type synonym expansion was done
| as a pre-pass.

Well, validity checking is done when (and only when) converting an HsType to a Type.  (The former being a programmer written type.)  That's just what we want.  It's done by checkValidType, which is not at all interleaved.  Once that check is done, the lazy expansion can, I think, be left to itself; no further checking is required.


More information about the Haskell-Cafe mailing list