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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b8739b28f5bc855b7c5406425b516698cf3b2f0d

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

commit b8739b28f5bc855b7c5406425b516698cf3b2f0d
Author: Simon Peyton Jones <simo...@microsoft.com>
Date:   Fri Dec 21 08:05:58 2012 +0000

    Allow newtypes to be promoted
    
    Fixes Trac #7488

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

 compiler/basicTypes/DataCon.lhs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/basicTypes/DataCon.lhs b/compiler/basicTypes/DataCon.lhs
index 1b14179..7a58a7b 100644
--- a/compiler/basicTypes/DataCon.lhs
+++ b/compiler/basicTypes/DataCon.lhs
@@ -1035,8 +1035,9 @@ isPromotableType _                 = False
 -- If tc's kind is [ *^n -> * ] returns [ Just n ], else returns [ Nothing ]
 isPromotableTyCon :: TyCon -> Maybe Int
 isPromotableTyCon tc
-  | isDataTyCon tc  -- Only *data* types can be promoted, not newtypes
-                   -- not synonyms, not type families
+  | isDataTyCon tc || isNewTyCon tc
+       -- Only *data* and *newtype* types can be promoted, 
+       -- not synonyms, not type/data families
   , all isLiftedTypeKind (res:args) = Just $ length args
   | otherwise                       = Nothing
   where



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to