diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-06-07 09:48:19 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-06-07 09:48:19 +0100 |
commit | a3f68cac382083d50f02616f3af7bfb47e79d50d (patch) | |
tree | 2c54f0aad3142519f0b3f912272aedebea8a73a1 | |
parent | bb08287cd11ed9a94b31fd0081422c3d6143aed4 (diff) | |
download | haskell-a3f68cac382083d50f02616f3af7bfb47e79d50d.tar.gz |
Do not promote data families
-rw-r--r-- | 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 2fbedd610c..aabc5d09c8 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) |