[commit: ghc] wip/rae: Remove extraneous fundeps on (~) (6b5f28f)

git at git.haskell.org git at git.haskell.org
Sat Feb 6 18:32:41 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/rae
Link       : http://ghc.haskell.org/trac/ghc/changeset/6b5f28fba0ab79e5a90beaf006b9d26ae06dd1fc/ghc

>---------------------------------------------------------------

commit 6b5f28fba0ab79e5a90beaf006b9d26ae06dd1fc
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Thu Feb 4 18:31:25 2016 -0500

    Remove extraneous fundeps on (~)


>---------------------------------------------------------------

6b5f28fba0ab79e5a90beaf006b9d26ae06dd1fc
 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