summaryrefslogtreecommitdiff
path: root/compiler/hsSyn
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-05-06 16:33:37 +0000
committersimonpj@microsoft.com <unknown>2010-05-06 16:33:37 +0000
commit215ce9f15215399ce30ae55c9521087847d78646 (patch)
treea5af9fd4f244f76176d4c597b8a0f0c53b21cb12 /compiler/hsSyn
parentb2d9ef8482638a91e68acdd19ecfe24db0458049 (diff)
downloadhaskell-215ce9f15215399ce30ae55c9521087847d78646.tar.gz
Fix Trac #3966: warn about useless UNPACK pragmas
Warning about useless UNPACK pragmas wasn't as easy as I thought. I did quite a bit of refactoring, which improved the code by refining the types somewhat. In particular notice that in DataCon, we have dcStrictMarks :: [HsBang] dcRepStrictness :: [StrictnessMarks] The former relates to the *source-code* annotation, the latter to GHC's representation choice.
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r--compiler/hsSyn/HsTypes.lhs11
1 files changed, 0 insertions, 11 deletions
diff --git a/compiler/hsSyn/HsTypes.lhs b/compiler/hsSyn/HsTypes.lhs
index 9b3930531e..cb06a7f548 100644
--- a/compiler/hsSyn/HsTypes.lhs
+++ b/compiler/hsSyn/HsTypes.lhs
@@ -102,17 +102,6 @@ ppr_qq (HsQuasiQuote quoter _ quote) =
type LBangType name = Located (BangType name)
type BangType name = HsType name -- Bangs are in the HsType data type
-data HsBang = HsNoBang -- Only used as a return value for getBangStrictness,
- -- never appears on a HsBangTy
- | HsStrict -- !
- | HsUnbox -- {-# UNPACK #-} ! (GHC extension, meaning "unbox")
- deriving (Data, Typeable)
-
-instance Outputable HsBang where
- ppr (HsNoBang) = empty
- ppr (HsStrict) = char '!'
- ppr (HsUnbox) = ptext (sLit "!!")
-
getBangType :: LHsType a -> LHsType a
getBangType (L _ (HsBangTy _ ty)) = ty
getBangType ty = ty