[commit: ghc] master: Comments only, about polykinded TyConApps (fe05764)

git at git.haskell.org git at git.haskell.org
Thu Nov 15 11:53:27 UTC 2018


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

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

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

commit fe0576426d3ef07d7743c65e34c8b04ce0616426
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Nov 5 13:48:27 2018 +0000

    Comments only, about polykinded TyConApps
    
    See Trac #15704 comment:8ff


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

fe0576426d3ef07d7743c65e34c8b04ce0616426
 compiler/types/Unify.hs | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs
index 951a3f9..62d53dc 100644
--- a/compiler/types/Unify.hs
+++ b/compiler/types/Unify.hs
@@ -888,6 +888,17 @@ Note that
 * One better way is to ensure that type patterns (the template
   in the matching process) have no casts.  See Trac #14119.
 
+Note [Polykinded tycon applications]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Suppose  T :: forall k. Type -> K
+and we are unifying
+  ty1:  T @Type         Int       :: Type
+  ty2:  T @(Type->Type) Int Int   :: Type
+
+These two TyConApps have the same TyCon at the front but they
+(legitimately) have different numbers of arguments.  They
+are surelyApart, so we can report that without looking any
+further (see Trac #15704).
 -}
 
 -------------- unify_ty: the main workhorse -----------
@@ -1025,7 +1036,8 @@ unify_tys env orig_xs orig_ys
       = do { unify_ty env x y (mkNomReflCo $ typeKind x)
            ; go xs ys }
     go _ _ = surelyApart
-      -- Possibly different saturations of a polykinded tycon (See Trac #15704)
+      -- Possibly different saturations of a polykinded tycon
+      -- See Note [Polykinded tycon applications]
 
 ---------------------------------
 uVar :: UMEnv



More information about the ghc-commits mailing list