[project @ 2000-02-25 14:55:31 by panne]
[ghc-hetmet.git] / ghc / compiler / rename / RnMonad.lhs
index 0b83f41..b07ec92 100644 (file)
@@ -31,7 +31,7 @@ import IOExts         ( IORef, newIORef, readIORef, writeIORef, unsafePerformIO )
        
 import HsSyn           
 import RdrHsSyn
-import RnHsSyn         ( RenamedFixitySig )
+import RnHsSyn         ( RenamedFixitySig, RenamedDeprecation )
 import BasicTypes      ( Version )
 import SrcLoc          ( noSrcLoc )
 import ErrUtils                ( addShortErrLocLine, addShortWarnLocLine,
@@ -193,6 +193,9 @@ type FixityEnv = NameEnv RenamedFixitySig
        -- We keep the whole fixity sig so that we
        -- can report line-number info when there is a duplicate
        -- fixity declaration
+
+--------------------------------
+type DeprecationEnv = NameEnv DeprecTxt
 \end{code}
 
 \begin{code}
@@ -283,17 +286,20 @@ data ParsedIface
       pi_exports   :: [ExportItem],                    -- Exports
       pi_decls    :: [(Version, RdrNameHsDecl)],       -- Local definitions
       pi_insts    :: [RdrNameInstDecl],                -- Local instance declarations
-      pi_rules    :: [RdrNameRuleDecl]                 -- Rules
+      pi_rules    :: [RdrNameRuleDecl],                -- Rules
+      pi_deprecs   :: [RdrNameDeprecation]             -- Deprecations
     }
 
-type InterfaceDetails = (WhetherHasOrphans,
-                        VersionInfo Name, -- Version information for what this module imports
-                        ExportEnv)        -- What modules this one depends on
+data InterfaceDetails
+   = InterfaceDetails WhetherHasOrphans
+                     (VersionInfo Name)   -- Version information for what this module imports
+                     ExportEnv            -- What modules this one depends on
+                     [Deprecation Name]
 
 
 -- needed by Main to fish out the fixities assoc list.
 getIfaceFixities :: InterfaceDetails -> Fixities
-getIfaceFixities (_, _, ExportEnv _ fs _) = fs
+getIfaceFixities (InterfaceDetails _ _ (ExportEnv _ fs _) _) = fs
 
 
 type RdrNamePragma = ()                                -- Fudge for now
@@ -327,8 +333,10 @@ data Ifaces = Ifaces {
                -- Each is 'gated' by the names that must be available before
                -- this instance decl is needed.
 
-               iRules :: Bag GatedDecl
+               iRules :: Bag GatedDecl,
                        -- Ditto transformation rules
+
+               iDeprecs :: DeprecationEnv
        }
 
 type GatedDecl = (NameSet, (Module, RdrNameHsDecl))
@@ -416,7 +424,8 @@ emptyIfaces = Ifaces { iImpModInfo = emptyFM,
                        -- and we don't want thereby to try to suck it in!
                       iVSlurp = [],
                       iInsts = emptyBag,
-                      iRules = emptyBag
+                      iRules = emptyBag,
+                      iDeprecs = emptyNameEnv
              }
 
 -- mkUnboundName makes a place-holder Name; it shouldn't be looked at except possibly