summaryrefslogtreecommitdiff
path: root/compiler/prelude
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-11-04 10:43:36 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-11-04 12:32:31 +0000
commit2cdd9bd5208e3ad78d7a3b8b82c8ae1be486b34d (patch)
tree0bccf87de19aa17d7675630f55ada70eab765493 /compiler/prelude
parent7b0ae417026c587dbc9697f678d560b1dc975d50 (diff)
downloadhaskell-2cdd9bd5208e3ad78d7a3b8b82c8ae1be486b34d.tar.gz
Take account of injectivity when doing fundeps
This fixes Trac #12803. Yikes! See Note [Care with type functions].
Diffstat (limited to 'compiler/prelude')
-rw-r--r--compiler/prelude/TysWiredIn.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs
index 7f4d072bfd..d3ba85e6e3 100644
--- a/compiler/prelude/TysWiredIn.hs
+++ b/compiler/prelude/TysWiredIn.hs
@@ -991,6 +991,11 @@ mk_sum arity = (tycon, sum_cons)
-- See Note [The equality types story] in TysPrim
-- (:~~: :: forall k1 k2 (a :: k1) (b :: k2). a -> b -> Constraint)
+--
+-- It's tempting to put functional dependencies on (~~), but it's not
+-- necessary because the functional-dependency coverage check looks
+-- through superclasses, and (~#) is handled in that check.
+
heqTyCon, coercibleTyCon :: TyCon
heqClass, coercibleClass :: Class
heqDataCon, coercibleDataCon :: DataCon