[commit: ghc] master: Do not promote data families (a3f68ca)
Simon Peyton Jones
simonpj at microsoft.com
Thu Jun 7 15:09:21 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/a3f68cac382083d50f02616f3af7bfb47e79d50d
>---------------------------------------------------------------
commit a3f68cac382083d50f02616f3af7bfb47e79d50d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Jun 7 09:48:19 2012 +0100
Do not promote data families
>---------------------------------------------------------------
compiler/basicTypes/DataCon.lhs | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/compiler/basicTypes/DataCon.lhs b/compiler/basicTypes/DataCon.lhs
index 2fbedd6..aabc5d0 100644
--- a/compiler/basicTypes/DataCon.lhs
+++ b/compiler/basicTypes/DataCon.lhs
@@ -1029,7 +1029,9 @@ isPromotableType ty
-- If tc's kind is [ *^n -> * ] returns [ Just n ], else returns [ Nothing ]
isPromotableTyCon :: TyCon -> Maybe Int
isPromotableTyCon tc
- | all isLiftedTypeKind (res:args) = Just $ length args
+ | isDataTyCon tc -- Only *data* types can be promoted, not newtypes
+ -- not synonyms, not type families
+ , all isLiftedTypeKind (res:args) = Just $ length args
| otherwise = Nothing
where
(args, res) = splitKindFunTys (tyConKind tc)
More information about the Cvs-ghc
mailing list