New syntax for GADT-style record declarations, and associated refactoring
[ghc-hetmet.git] / compiler / basicTypes / IdInfo.lhs
index 07cc181..fb18c81 100644 (file)
@@ -277,7 +277,6 @@ instance Outputable IdDetails where
 
 pprIdDetails :: IdDetails -> SDoc
 pprIdDetails VanillaId         = empty
-pprIdDetails (RecSelId {})  = ptext (sLit "[RecSel]")
 pprIdDetails (DataConWorkId _) = ptext (sLit "[DataCon]")
 pprIdDetails (DataConWrapId _) = ptext (sLit "[DataConWrapper]")
 pprIdDetails (ClassOpId _)     = ptext (sLit "[ClassOp]")
@@ -285,11 +284,14 @@ pprIdDetails (PrimOpId _)      = ptext (sLit "[PrimOp]")
 pprIdDetails (FCallId _)       = ptext (sLit "[ForeignCall]")
 pprIdDetails (TickBoxOpId _)   = ptext (sLit "[TickBoxOp]")
 pprIdDetails DFunId            = ptext (sLit "[DFunId]")
+pprIdDetails (RecSelId { sel_naughty = is_naughty })
+  = brackets $ ptext (sLit "RecSel") <> pp_naughty
+  where
+    pp_naughty | is_naughty = ptext (sLit "(naughty)")
+              | otherwise  = empty
 \end{code}
 
 
-
-
 %************************************************************************
 %*                                                                     *
 \subsection{The main IdInfo type}
@@ -329,7 +331,7 @@ data IdInfo
        unfoldingInfo   :: Unfolding,           -- ^ The 'Id's unfolding
        cafInfo         :: CafInfo,             -- ^ 'Id' CAF info
         lbvarInfo      :: LBVarInfo,           -- ^ Info about a lambda-bound variable, if the 'Id' is one
-       inlinePragInfo  :: InlinePragInfo,      -- ^ Any inline pragma atached to the 'Id'
+       inlinePragInfo  :: InlinePragma,        -- ^ Any inline pragma atached to the 'Id'
        occInfo         :: OccInfo,             -- ^ How the 'Id' occurs in the program
 
        newStrictnessInfo :: Maybe StrictSig,   -- ^ Id strictness information. Reason for Maybe: 
@@ -378,7 +380,7 @@ setWorkerInfo :: IdInfo -> WorkerInfo -> IdInfo
 setWorkerInfo     info wk = wk `seq` info { workerInfo = wk }
 setSpecInfo :: IdInfo -> SpecInfo -> IdInfo
 setSpecInfo      info sp = sp `seq` info { specInfo = sp }
-setInlinePragInfo :: IdInfo -> InlinePragInfo -> IdInfo
+setInlinePragInfo :: IdInfo -> InlinePragma -> IdInfo
 setInlinePragInfo info pr = pr `seq` info { inlinePragInfo = pr }
 setOccInfo :: IdInfo -> OccInfo -> IdInfo
 setOccInfo       info oc = oc `seq` info { occInfo = oc }
@@ -434,7 +436,7 @@ vanillaIdInfo
            workerInfo          = NoWorker,
            unfoldingInfo       = noUnfolding,
            lbvarInfo           = NoLBVarInfo,
-           inlinePragInfo      = AlwaysActive,
+           inlinePragInfo      = defaultInlinePragma,
            occInfo             = NoOccInfo,
            newDemandInfo       = Nothing,
            newStrictnessInfo   = Nothing
@@ -493,7 +495,7 @@ ppArityInfo n = hsep [ptext (sLit "Arity"), int n]
 --
 -- The default 'InlinePragInfo' is 'AlwaysActive', so the info serves
 -- entirely as a way to inhibit inlining until we want it
-type InlinePragInfo = Activation
+type InlinePragInfo = InlinePragma
 \end{code}