[commit: ghc] master: Drop redundant Note (50a35e5)

git at git.haskell.org git at git.haskell.org
Thu Jun 21 15:31:16 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/50a35e59034c8616ce5b0fcd3ca2b1757273a552/ghc

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

commit 50a35e59034c8616ce5b0fcd3ca2b1757273a552
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Thu Jun 21 11:29:53 2018 -0400

    Drop redundant Note
    
    Richard added a much better version of this Note in commit
    26e9806ada8823160dd63ca2c34556e5848b2f45, so I've decided to point
    to that instead.


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

50a35e59034c8616ce5b0fcd3ca2b1757273a552
 compiler/typecheck/TcHsType.hs | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs
index 205ec9e..322863f 100644
--- a/compiler/typecheck/TcHsType.hs
+++ b/compiler/typecheck/TcHsType.hs
@@ -1204,7 +1204,7 @@ tcTyVar mode name         -- Could be a tyvar, a tycon, or a datacon
 
     -- We cannot promote a data constructor with a context that contains
     -- constraints other than equalities, so error if we find one.
-    -- See Note [Don't promote data constructors with non-equality contexts]
+    -- See Note [Constraints handled in types] in Inst.
     dc_theta_illegal_constraint :: ThetaType -> Maybe PredType
     dc_theta_illegal_constraint = find go
       where
@@ -1378,25 +1378,6 @@ in the e2 example, we'll desugar the type, zonking the kind unification
 variables as we go.  When we encounter the unconstrained kappa, we
 want to default it to '*', not to (Any *).
 
-Note [Don't promote data constructors with non-equality contexts]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-With -XTypeInType, one can promote almost any data constructor. There is a
-notable exception to this rule, however: data constructors that contain
-non-equality constraints, such as:
-
-  data Foo a where
-    MkFoo :: Show a => Foo a
-
-MkFoo cannot be promoted since GHC cannot produce evidence for (Show a) at the
-kind level. Therefore, we check the context of each data constructor before
-promotion, and give a sensible error message if the context contains an illegal
-constraint.
-
-Note that equality constraints (i.e, (~) and (~~)) /are/
-permitted inside data constructor contexts. All other constraints are
-off-limits, however (and likely will remain off-limits until dependent types
-become a reality in GHC).
-
 Help functions for type applications
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 -}



More information about the ghc-commits mailing list