#include "HsVersions.h"
-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 405
-import IOExts ( fixIO )
-#elif defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 302
-import PrelIOBase ( fixIO ) -- Should be in GlaExts
-#else
-import IOBase ( fixIO )
-#endif
-import IOExts ( IORef, newIORef, readIORef, writeIORef, unsafePerformIO )
-import IO ( hPutStr, stderr )
-
import HsSyn
import RdrHsSyn
import RnHsSyn ( RenamedFixitySig )
import HscTypes ( AvailEnv, emptyAvailEnv, lookupType,
NameSupply(..),
ImportedModuleInfo, WhetherHasOrphans, ImportVersion,
- PersistentRenamerState(..),
+ PersistentRenamerState(..), RdrExportItem,
DeclsMap, IfaceInsts, IfaceRules,
HomeSymbolTable, TyThing,
- PersistentCompilerState(..), GlobalRdrEnv, LocalRdrEnv,
- HomeIfaceTable, PackageIfaceTable,
- RdrAvailInfo )
-import BasicTypes ( Version, defaultFixity )
+ PersistentCompilerState(..), GlobalRdrEnv,
+ LocalRdrEnv,
+ HomeIfaceTable, PackageIfaceTable )
+import BasicTypes ( Version, defaultFixity,
+ Fixity(..), FixityDirection(..) )
import ErrUtils ( addShortErrLocLine, addShortWarnLocLine,
Message, Messages, errorsFound, warningsFound,
printErrorsAndWarnings
RdrNameEnv, emptyRdrEnv, extendRdrEnv,
addListToRdrEnv, rdrEnvToList, rdrEnvElts
)
+import Id ( idName )
+import MkId ( seqId )
import Name ( Name, OccName, NamedThing(..),
- nameOccName,
- decode, mkLocalName, mkKnownKeyGlobal
+ nameOccName, nameRdrName,
+ decode, mkInternalName
)
-import NameEnv ( NameEnv, lookupNameEnv, emptyNameEnv, extendNameEnvList )
-import Module ( Module, ModuleName, ModuleSet, emptyModuleSet, PackageName )
+import NameEnv ( NameEnv, lookupNameEnv, emptyNameEnv,
+ extendNameEnvList )
+import Module ( Module, ModuleName, ModuleSet, emptyModuleSet,
+ PackageName, preludePackage )
+import PrelInfo ( ghcPrimExports,
+ cCallableClassDecl, cReturnableClassDecl, assertDecl )
+import PrelNames ( mkUnboundName, gHC_PRIM_Name )
import NameSet
import CmdLineOpts ( DynFlags, DynFlag(..), dopt )
import SrcLoc ( SrcLoc, generatedSrcLoc, noSrcLoc )
import Bag ( Bag, emptyBag, isEmptyBag, snocBag )
import UniqSupply
import Outputable
-import PrelNames ( mkUnboundName )
+import IOExts ( IORef, newIORef, readIORef, writeIORef,
+ fixIO, unsafePerformIO )
+import IO ( hPutStr, stderr )
+
infixr 9 `thenRn`, `thenRn_`
\end{code}
Nothing -> defaultFixity
\end{code}
-
-%===================================================
-\subsubsection{ INTERFACE FILE STUFF}
-%===================================================
+%************************************************************************
+%* *
+\subsection{Interface file stuff}
+%* *
+%************************************************************************
\begin{code}
-type ExportItem = (ModuleName, [RdrAvailInfo])
type IfaceDeprecs = Maybe (Either DeprecTxt [(RdrName,DeprecTxt)])
-- Nothing => NoDeprecs
-- Just (Left t) => DeprecAll
pi_vers :: Version, -- Module version number
pi_orphan :: WhetherHasOrphans, -- Whether this module has orphans
pi_usages :: [ImportVersion OccName], -- Usages
- pi_exports :: (Version, [ExportItem]), -- Exports
+ pi_exports :: (Version, [RdrExportItem]), -- Exports
pi_decls :: [(Version, RdrNameTyClDecl)], -- Local definitions
- pi_fixity :: [RdrNameFixitySig], -- Local fixity declarations,
+ pi_fixity :: [(RdrName,Fixity)], -- Local fixity declarations,
pi_insts :: [RdrNameInstDecl], -- Local instance declarations
pi_rules :: (Version, [RdrNameRuleDecl]), -- Rules, with their version
pi_deprecs :: IfaceDeprecs -- Deprecations
%************************************************************************
%* *
+\subsection{Wired-in interfaces}
+%* *
+%************************************************************************
+
+\begin{code}
+ghcPrimIface :: ParsedIface
+ghcPrimIface = ParsedIface {
+ pi_mod = gHC_PRIM_Name,
+ pi_pkg = preludePackage,
+ pi_vers = 1,
+ pi_orphan = False,
+ pi_usages = [],
+ pi_exports = (1, [(gHC_PRIM_Name, ghcPrimExports)]),
+ pi_decls = [(1,cCallableClassDecl),
+ (1,cReturnableClassDecl),
+ (1,assertDecl)],
+ pi_fixity = [(nameRdrName (idName seqId), Fixity 0 InfixR)],
+ -- seq is infixr 0
+ pi_insts = [],
+ pi_rules = (1,[]),
+ pi_deprecs = Nothing
+ }
+\end{code}
+
+%************************************************************************
+%* *
\subsection{The renamer state}
%* *
%************************************************************************