[commit: ghc] ghc-8.0: Remove extraneous fundeps on (~) (e1631b3)

git at git.haskell.org git at git.haskell.org
Thu Feb 18 12:03:05 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/e1631b3b58b7440d3d5a8bf72f1490df635792fb/ghc

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

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

    Remove extraneous fundeps on (~)
    
    (cherry picked from commit 7d8031ba3d36a9378a40834aa3e3817d8f7f310f)


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

e1631b3b58b7440d3d5a8bf72f1490df635792fb
 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