[commit: ghc] wip/rae: Remove extraneous fundeps on (~) (cc8ef3c)
git at git.haskell.org
git at git.haskell.org
Sun Feb 7 19:06:55 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/rae
Link : http://ghc.haskell.org/trac/ghc/changeset/cc8ef3c124f73319e19a3a379fc9f0c20a6e268a/ghc
>---------------------------------------------------------------
commit cc8ef3c124f73319e19a3a379fc9f0c20a6e268a
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date: Thu Feb 4 18:31:25 2016 -0500
Remove extraneous fundeps on (~)
>---------------------------------------------------------------
cc8ef3c124f73319e19a3a379fc9f0c20a6e268a
libraries/base/Data/Type/Equality.hs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libraries/base/Data/Type/Equality.hs b/libraries/base/Data/Type/Equality.hs
index 75d2a6c..e7363d2 100644
--- a/libraries/base/Data/Type/Equality.hs
+++ b/libraries/base/Data/Type/Equality.hs
@@ -54,7 +54,7 @@ import Data.Type.Bool
-- | Lifted, homogeneous equality. By lifted, we mean that it can be
-- bogus (deferred type error). By homogeneous, the two types @a@
-- and @b@ must have the same kind.
-class a ~~ b => (a :: k) ~ (b :: k) | a -> b, b -> a
+class a ~~ b => (a :: k) ~ (b :: k)
-- See Note [The equality types story] in TysPrim
-- NB: All this class does is to wrap its superclass, which is
-- the "real", inhomogeneous equality; this is needed when
@@ -62,6 +62,10 @@ class a ~~ b => (a :: k) ~ (b :: k) | a -> b, b -> a
-- NB: Not exported, as (~) is magical syntax. That's also why there's
-- no fixity.
+ -- It's tempting to put functional dependencies on (~), but it's not
+ -- necessary because the functional-depedency coverage check looks
+ -- through superclasses, and (~#) is handled in that check.
+
instance {-# INCOHERENT #-} a ~~ b => a ~ b
-- See Note [The equality types story] in TysPrim
-- If we have a Wanted (t1 ~ t2), we want to immediately
More information about the ghc-commits
mailing list