summaryrefslogtreecommitdiff
path: root/compiler/basicTypes/BasicTypes.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/basicTypes/BasicTypes.hs')
-rw-r--r--compiler/basicTypes/BasicTypes.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs
index cf56957f7b..200e5c9b8a 100644
--- a/compiler/basicTypes/BasicTypes.hs
+++ b/compiler/basicTypes/BasicTypes.hs
@@ -28,6 +28,7 @@ module BasicTypes(
Alignment,
+ PromotionFlag(..), isPromoted,
FunctionOrData(..),
WarningTxt(..), pprWarningTxtForMsg, StringLiteral(..),
@@ -270,6 +271,24 @@ unSwap :: SwapFlag -> (a->a->b) -> a -> a -> b
unSwap NotSwapped f a b = f a b
unSwap IsSwapped f a b = f b a
+
+{- *********************************************************************
+* *
+ Promotion flag
+* *
+********************************************************************* -}
+
+-- | Is a TyCon a promoted data constructor or just a normal type constructor?
+data PromotionFlag
+ = NotPromoted
+ | IsPromoted
+ deriving ( Eq, Data )
+
+isPromoted :: PromotionFlag -> Bool
+isPromoted IsPromoted = True
+isPromoted NotPromoted = False
+
+
{-
************************************************************************
* *