[project @ 2000-10-17 12:48:34 by sewardj]
[ghc-hetmet.git] / ghc / compiler / main / HscTypes.lhs
index 12bbfcf..9a6dfd1 100644 (file)
@@ -8,7 +8,7 @@ module HscTypes (
        ModDetails(..), GlobalSymbolTable, 
        HomeSymbolTable, PackageSymbolTable,
 
-       TyThing(..), lookupTypeEnv,
+       TyThing(..), lookupTypeEnv, lookupFixityEnv,
 
        WhetherHasOrphans, ImportVersion, ExportItem,
        PersistentRenamerState(..), IsBootInterface, Avails, DeclsMap,
@@ -20,6 +20,8 @@ module HscTypes (
 
        GlobalRdrEnv, RdrAvailInfo,
 
+       CompResult(..), HscResult(..),
+
        -- Provenance
        Provenance(..), ImportReason(..), PrintUnqualified,
         pprNameProvenance, hasBetterProv
@@ -49,6 +51,7 @@ import ErrUtils               ( ErrMsg, WarnMsg )
 import CmLink          ( Linkable )
 import RdrHsSyn                ( RdrNameInstDecl, RdrNameRuleDecl, RdrNameHsDecl,
                          RdrNameDeprecation, RdrNameFixitySig )
+import InterpSyn       ( UnlinkedIBind )
 import UniqSupply      ( UniqSupply )
 import HsDecls         ( DeprecTxt )
 import CoreSyn         ( CoreRule )
@@ -91,12 +94,29 @@ data ModDetails
         md_rules    :: RuleEnv         -- Domain may include Ids from other modules
      }
 
+-- 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}
 
 \begin{code}
 emptyModDetails :: Module -> ModDetails
 emptyModDetails mod
-  = ModDetails { md_id       = mod,
+  = ModDetails { md_module   = mod,
                 md_exports  = [],
                 md_globals  = emptyRdrEnv,
                 md_fixities = emptyNameEnv,
@@ -391,14 +411,14 @@ data HscResult
             (Maybe ModIFace)        -- new iface (if any compilation was done)
             (Maybe String)          -- generated stub_h filename (in /tmp)
             (Maybe String)          -- generated stub_c filename (in /tmp)
+            (Maybe [UnlinkedIBind]) -- interpreted code, if any
              PersistentCompilerState -- updated PCS
-             [SDoc]                  -- warnings
+             (Bag WarnMsg)             -- warnings
 
    | HscErrs PersistentCompilerState -- updated PCS
-             [SDoc]                  -- errors
-             [SDoc]                  -- warnings
+             (Bag ErrMsg)              -- errors
+             (Bag WarnMsg)             -- warnings
 
-       
 -- These two are only here to avoid recursion between CmCompile and
 -- CompManager.  They really ought to be in the latter.
 type ModuleEnv a = UniqFM a   -- Domain is Module