Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/869044056c54dfe95017c19bef5274b748cfe724

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

commit 869044056c54dfe95017c19bef5274b748cfe724
Author: Simon Peyton Jones <[email protected]>
Date:   Fri May 18 10:10:28 2012 +0100

    Wibbles to lunaris's patch for promoted kinds

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

 compiler/deSugar/DsMeta.hs |   18 +++++++-----------
 compiler/hsSyn/Convert.lhs |    9 ++++++---
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index c9fa60d..6d1520b 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/deSugar/DsMeta.hs
@@ -722,19 +722,15 @@ repTy (HsForAllTy _ tvs ctxt ty)  =
     repTForall bndrs ctxt1 ty1
 
 repTy (HsTyVar n)
-  | isTvOcc occ = do
-                               tv1 <- lookupOcc n
-                               repTvar tv1
-  | n == consDataConName = repPromotedConsTyCon
-  | isDataOcc occ = do
-                      tc1 <- lookupOcc n
-                      repPromotedTyCon tc1
-  | otherwise              = do
-                               tc1 <- lookupOcc n
-                               repNamedTyCon tc1
-
+  | isTvOcc occ   = do tv1 <- lookupOcc n
+                      repTvar tv1
+  | isDataOcc occ = do tc1 <- lookupOcc n
+                       repPromotedTyCon tc1
+  | otherwise    = do tc1 <- lookupOcc n
+                      repNamedTyCon tc1
   where
     occ = nameOccName n
+
 repTy (HsAppTy f a)         = do
                                f1 <- repLTy f
                                a1 <- repLTy a
diff --git a/compiler/hsSyn/Convert.lhs b/compiler/hsSyn/Convert.lhs
index f4aae3f..ef17c60 100644
--- a/compiler/hsSyn/Convert.lhs
+++ b/compiler/hsSyn/Convert.lhs
@@ -876,9 +876,12 @@ cvtTypeKind ty_str ty
            PromotedNilT
              -> returnL (HsExplicitListTy placeHolderKind [])
 
-           PromotedConsT
-             | [ty1, ty2] <- tys'
-             -> mk_apps (HsTyVar (getRdrName consDataCon)) [ty1, ty2]
+           PromotedConsT  -- See Note [Representing concrete syntax in types] 
+                          -- in Language.Haskell.TH.Syntax
+             | [ty1, L _ (HsExplicitListTy _ tys2)] <- tys'
+             -> returnL (HsExplicitListTy placeHolderKind (ty1:tys2))
+             | otherwise 
+             -> mk_apps (HsTyVar (getRdrName consDataCon)) tys'
 
            StarT
              -> returnL (HsTyVar (getRdrName liftedTypeKindTyCon))



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to