[project @ 2000-10-16 10:05:00 by sewardj]
[ghc-hetmet.git] / ghc / compiler / ghci / CmCompile.lhs
index 50f2cd0..f06b793 100644 (file)
@@ -16,24 +16,26 @@ where
 
 #include "HsVersions.h"
 
-import CmLink          ( Linkable(..) )
-import Outputable      ( SDoc )
-import CmFind          ( Finder )
-import CmSummarise     ( ModSummary, name_of_summary )
-import FiniteMap       ( FiniteMap, emptyFM )
-
-import Module          ( Module )
-import RnMonad         ( Avails, GlobalRdrEnv, DeclsMap, 
-                          WhetherHasOrphans, ImportVersion,
-                          IfaceInsts, IfaceRules, ExportItem )
-import TcEnv           ( TyThing, InstEnv )
-import Name            ( Name, OccName )
-import BasicTypes      ( Fixity, Version )
-import Id              ( Id )
-import CoreSyn         ( CoreRule )
-import RdrHsSyn                ( RdrNameDeprecation, RdrNameRuleDecl, RdrNameFixitySig,
-                          RdrNameHsDecl, RdrNameInstDecl )
-
+-- many of these need to be moved to HscTypes
+--import CmLink                ( Linkable(..) )
+--import Outputable    ( SDoc )
+--import CmFind                ( Finder )
+--import CmSummarise   ( ModSummary, name_of_summary )
+--import FiniteMap     ( FiniteMap, emptyFM )
+
+--import Module                ( Module )
+--import RnMonad               ( Avails, GlobalRdrEnv, DeclsMap, 
+--                          WhetherHasOrphans, ImportVersion,
+--                          IfaceInsts, IfaceRules, ExportItem )
+--import TcEnv         ( TyThing, InstEnv )
+--import Name          ( Name, OccName )
+--import BasicTypes    ( Fixity, Version )
+--import Id            ( Id )
+--import CoreSyn               ( CoreRule )
+--import RdrHsSyn              ( RdrNameDeprecation, RdrNameRuleDecl, RdrNameFixitySig,
+--                          RdrNameHsDecl, RdrNameInstDecl )
+
+import HscTypes                ( )
 
 \end{code}
 
@@ -97,24 +99,10 @@ type HomeInterfaceTable = ModuleEnv ModIFace
 
 A @ModDetails@ summarises everything we know about a compiled module
 
-\begin{code}
-data ModDetails
-   = ModDetails {
-        moduleExports :: Avails,               -- What it exports
-        moduleEnv     :: GlobalRdrEnv,         -- Its top level environment
-
-        fixityEnv     :: NameEnv Fixity,
-       deprecEnv     :: NameEnv DeprecTxt,
-        typeEnv       :: NameEnv TyThing,      -- TyThing is in TcEnv.lhs
-
-        instEnv       :: InstEnv,
-        ruleEnv       :: IdEnv [CoreRule]      -- Domain includes Ids from other modules
-     }
-\end{code}
-
 Auxiliary definitions
 
 \begin{code}
+{- I DONT think this should be here -- should be in HscTypes 
 type DeprecationEnv = NameEnv DeprecTxt                -- Give reason for deprecation
 
 type GlobalRdrEnv = RdrNameEnv [Name]  -- The list is because there may be name clashes
@@ -134,6 +122,7 @@ type AvailEnv         = NameEnv AvailInfo   -- Maps a Name to the AvailInfo that contain
 type AvailInfo    = GenAvailInfo Name
 type RdrAvailInfo = GenAvailInfo OccName
 type Avails      = [AvailInfo]
+-}
 \end{code}
 
 
@@ -147,7 +136,7 @@ type Avails   = [AvailInfo]
 data PersistentCompilerState 
    = PCS {
         pcsPST    :: PackageSymbolTable,       -- Domain = non-home-package modules
-        pcsHP     :: HoldingPen,               -- Pre-slurped interface bits and pieces
+        pcsHP     :: RnMonad.HoldingPen,       -- Pre-slurped interface bits and pieces
        pcsNS     :: NameSupply                 -- Allocate uniques for names
      }
 
@@ -158,31 +147,17 @@ data NameSupply
        nsNames  :: FiniteMap (Module,OccName) Name     -- Ensures that one original name gets one unique
        nsIParam :: FiniteMap OccName Name              -- Ensures that one implicit parameter name gets one unique
    }
+=======
+>>>>>>> 1.9
+=======
+
+-- should be somewhere else?
+emptyPCS :: IO PersistentCompilerState
+emptyPCS = return (PersistentCompilerState 
+                      { pcs_modmap = emptyFM,
+                        pcs_pit    = emptyPIT,
+                        pcs_pst    = emptyPST,
+                        pcs_hp     = emptyHoldingPen })
+>>>>>>> 1.10
 \end{code}
 
-
-%************************************************************************
-%*                                                                     *
-\subsection{ModIface}
-%*                                                                     *
-%************************************************************************
-
-\begin{code}
--- ModIFace is nearly the same as RnMonad.ParsedIface.
--- Right now it's identical :)
-data ModIFace 
-   = ModIFace {
-        mi_mod       :: Module,                   -- Complete with package info
-        mi_vers      :: Version,                  -- Module version number
-        mi_orphan    :: WhetherHasOrphans,        -- Whether this module has orphans
-        mi_usages    :: [ImportVersion OccName],  -- Usages
-        mi_exports   :: [ExportItem],             -- Exports
-        mi_insts     :: [RdrNameInstDecl],        -- Local instance declarations
-        mi_decls     :: [(Version, RdrNameHsDecl)],    -- Local definitions
-        mi_fixity    :: (Version, [RdrNameFixitySig]), -- Local fixity declarations, 
-                                                       -- with their version
-        mi_rules     :: (Version, [RdrNameRuleDecl]),  -- Rules, with their version
-        mi_deprecs   :: [RdrNameDeprecation]           -- Deprecations
-     }
-
-\end{code}