[project @ 1998-02-03 17:13:54 by simonm]
authorsimonm <unknown>
Tue, 3 Feb 1998 17:16:13 +0000 (17:16 +0000)
committersimonm <unknown>
Tue, 3 Feb 1998 17:16:13 +0000 (17:16 +0000)
- Fixes for bootstrapping with 3.01.
  - Use 'official' extension interfaces rather than internal prelude
    modules (such as ArrBase) where possible.
  - Remove some cruft.
  - Delete some unused imports found by '-fwarn-unused-imports'.

51 files changed:
ghc/compiler/HsVersions.h
ghc/compiler/basicTypes/Id.lhs
ghc/compiler/basicTypes/IdInfo.lhs
ghc/compiler/basicTypes/IdUtils.lhs
ghc/compiler/basicTypes/Name.lhs
ghc/compiler/basicTypes/UniqSupply.lhs
ghc/compiler/basicTypes/Unique.lhs
ghc/compiler/coreSyn/CoreSyn.lhs
ghc/compiler/coreSyn/CoreUnfold.lhs
ghc/compiler/coreSyn/CoreUtils.lhs
ghc/compiler/coreSyn/PprCore.lhs
ghc/compiler/hsSyn/HsBinds.lhs
ghc/compiler/hsSyn/HsCore.lhs
ghc/compiler/hsSyn/HsDecls.lhs
ghc/compiler/hsSyn/HsPat.lhs
ghc/compiler/hsSyn/HsPragmas.lhs
ghc/compiler/hsSyn/HsTypes.lhs
ghc/compiler/main/CmdLineOpts.lhs
ghc/compiler/parser/UgenUtil.lhs
ghc/compiler/prelude/PrelInfo.lhs
ghc/compiler/prelude/PrelVals.lhs
ghc/compiler/prelude/StdIdInfo.lhs
ghc/compiler/prelude/TysPrim.lhs
ghc/compiler/profiling/CostCentre.lhs
ghc/compiler/reader/Lex.lhs
ghc/compiler/reader/RdrHsSyn.lhs
ghc/compiler/rename/Rename.lhs
ghc/compiler/rename/RnBinds.lhs
ghc/compiler/rename/RnEnv.lhs
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/rename/RnIfaces.lhs
ghc/compiler/rename/RnNames.lhs
ghc/compiler/rename/RnSource.lhs
ghc/compiler/simplCore/OccurAnal.lhs
ghc/compiler/simplCore/SimplEnv.lhs
ghc/compiler/specialise/SpecEnv.lhs
ghc/compiler/stranal/WwLib.lhs
ghc/compiler/types/Class.lhs
ghc/compiler/types/TyCon.lhs
ghc/compiler/types/Type.lhs
ghc/compiler/utils/Argv.lhs
ghc/compiler/utils/Digraph.lhs
ghc/compiler/utils/FastString.lhs
ghc/compiler/utils/ListSetOps.lhs
ghc/compiler/utils/OrdList.lhs
ghc/compiler/utils/Outputable.lhs
ghc/compiler/utils/PrimPacked.lhs
ghc/compiler/utils/SST.lhs
ghc/compiler/utils/StringBuffer.lhs
ghc/compiler/utils/UniqFM.lhs
ghc/compiler/utils/UniqSet.lhs

index 2e1b154..cd5c220 100644 (file)
@@ -43,9 +43,6 @@ you will screw up the layout where they are used in case expressions!
 # define seqStrictlyST seqST
 # define thenStrictlyST thenST
 # define returnStrictlyST return
-# define _readHandle IOHandle.readHandle
-# define _writeHandle IOHandle.writeHandle
-# define _newHandle   IOHandle.newdHandle
 # define MkST ST
 # if __GLASGOW_HASKELL__ >= 209
 #  define STATE_TOK(x)    x
@@ -61,7 +58,6 @@ you will screw up the layout where they are used in case expressions!
 # define failWith fail
 # define MkIOError(h,errt,msg) (IOError (Just h) errt msg)
 # define CCALL_THEN thenIO_Prim
-# define _filePtr IOHandle.filePtr
 # define Text Show
 # define IMP_FASTSTRING() import FastString
 # if __GLASGOW_HASKELL__ >= 209
@@ -93,9 +89,10 @@ you will screw up the layout where they are used in case expressions!
 #if defined(__GLASGOW_HASKELL__)
 
 -- Import the beggars
-import GlaExts ( Int(..), Int#, (+#), (-#), (*#), 
-                 quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
-               )
+import GlaExts
+       ( Int(..), Int#, (+#), (-#), (*#), 
+         quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
+       )
 
 #define FAST_INT Int#
 #define ILIT(x) (x#)
@@ -146,24 +143,22 @@ import GlaExts    ( Int(..), Int#, (+#), (-#), (*#),
 -- when compiling FastString itself
 #ifndef COMPILING_FAST_STRING
 -- 
-import FastString      ( FastString, mkFastString, mkFastCharString#, nullFastString, 
-                         consFS, headFS, tailFS, lengthFS, unpackFS, appendFS, concatFS
-                       )
+import qualified FastString 
 #endif
 
 # define USE_FAST_STRINGS 1
-# define FAST_STRING   FastString
-# define SLIT(x)       (mkFastCharString# (x#))
-# define _NULL_                nullFastString
-# define _NIL_         (mkFastString "")
-# define _CONS_                consFS
-# define _HEAD_                headFS
-# define _TAIL_                tailFS
-# define _LENGTH_      lengthFS
-# define _PK_          mkFastString
-# define _UNPK_                unpackFS
-# define _APPEND_      `appendFS`
-# define _CONCAT_      concatFS
+# define FAST_STRING   FastString.FastString
+# define SLIT(x)       (FastString.mkFastCharString# (x#))
+# define _NULL_                FastString.nullFastString
+# define _NIL_         (FastString.mkFastString "")
+# define _CONS_                FastString.consFS
+# define _HEAD_                FastString.headFS
+# define _TAIL_                FastString.tailFS
+# define _LENGTH_      FastString.lengthFS
+# define _PK_          FastString.mkFastString
+# define _UNPK_                FastString.unpackFS
+# define _APPEND_      `FastString.appendFS`
+# define _CONCAT_      FastString.concatFS
 #else
 # define FAST_STRING String
 # define SLIT(x)      (x)
index dc1cca8..5113340 100644 (file)
@@ -148,23 +148,20 @@ import BasicTypes ( Arity )
 import IdInfo
 import Maybes          ( maybeToBool )
 import Name            ( nameUnique, mkLocalName, mkSysLocalName, isLocalName,
-                         mkCompoundName,
-                         isLocallyDefinedName, occNameString, modAndOcc,
-                         isLocallyDefined, changeUnique, isWiredInName,
-                         nameString, getOccString, setNameVisibility,
-                         isExported, ExportFlag(..), Provenance,
+                         mkCompoundName, occNameString, modAndOcc,
+                         changeUnique, isWiredInName, setNameVisibility,
+                         ExportFlag(..), Provenance,
                          OccName(..), Name, Module,
                          NamedThing(..)
                        ) 
 import PrimOp          ( PrimOp )
 import PrelMods                ( pREL_TUP, pREL_BASE )
-import Lex             ( mkTupNameStr )
 import FieldLabel      ( fieldLabelName, FieldLabel(..){-instances-} )
 import PragmaInfo      ( PragmaInfo(..) )
 import SrcLoc          ( mkBuiltinSrcLoc )
 import TysWiredIn      ( tupleTyCon )
 import TyCon           ( TyCon, tyConDataCons, isDataTyCon, isNewTyCon, mkSpecTyCon )
-import Type            ( mkSigmaTy, mkTyVarTys, mkFunTys, splitSigmaTy,
+import Type            ( mkSigmaTy, mkTyVarTys, mkFunTys,
                          mkTyConApp, instantiateTy, mkForAllTys,
                          tyVarsOfType, instantiateTy, typePrimRep,
                          instantiateTauTy,
@@ -175,10 +172,10 @@ import TyVar              ( TyVar, alphaTyVars, isEmptyTyVarSet,
                        )
 import UniqFM
 import UniqSet         -- practically all of it
-import Unique          ( getBuiltinUniques, pprUnique, Unique, Uniquable(..) )
+import Unique          ( getBuiltinUniques, Unique, Uniquable(..) )
 import Outputable
 import SrcLoc          ( SrcLoc )
-import Util            ( mapAccumL, nOfThem, zipEqual, assoc )
+import Util            ( nOfThem, assoc )
 import GlaExts         ( Int# )
 \end{code}
 
index 8539d00..d50a60e 100644 (file)
@@ -54,13 +54,9 @@ import SpecEnv               ( SpecEnv, emptySpecEnv, isEmptySpecEnv )
 import BasicTypes      ( NewOrData )
 
 import Demand
-import Maybes          ( firstJust )
 import Outputable      
-import Unique          ( pprUnique )
-import Util            ( mapAccumL )
 
-ord = fromEnum :: Char -> Int
-showTypeCategory = panic "IdInfo.showTypeCategory"
+import Char            ( ord )
 \end{code}
 
 An @IdInfo@ gives {\em optional} information about an @Id@.  If
@@ -376,11 +372,7 @@ updateInfoMaybe (SomeUpdateInfo     u) = Just u
 Text instance so that the update annotations can be read in.
 
 \begin{code}
-#ifdef REALLY_HASKELL_1_3
 instance Read UpdateInfo where
-#else
-instance Text UpdateInfo where
-#endif
     readsPrec p s | null s    = panic "IdInfo: empty update pragma?!"
                  | otherwise = [(SomeUpdateInfo (map ok_digit s),"")]
       where
@@ -429,8 +421,10 @@ argUsageInfo (IdInfo _ _ _ _ _ _ au _) = au
 addArgUsageInfo id_info                           NoArgUsageInfo = id_info
 addArgUsageInfo (IdInfo a b d e f g _ h) au_info         = IdInfo a b d e f g au_info h
 
+{- UNUSED:
 ppArgUsageInfo NoArgUsageInfo    = empty
 ppArgUsageInfo (SomeArgUsageInfo aut) = (<>) (ptext SLIT("_L_ ")) (ppArgUsageType aut)
+-}
 
 ppArgUsage (ArgUsage n)      = int n
 ppArgUsage (UnknownArgUsage) = char '-'
index 7307caa..fe04abf 100644 (file)
@@ -9,15 +9,14 @@ module IdUtils ( primOpName ) where
 #include "HsVersions.h"
 
 import CoreSyn
-import CoreUnfold      ( UnfoldingGuidance(..), Unfolding, mkUnfolding )
+import CoreUnfold      ( Unfolding )
 import Id              ( mkPrimitiveId )
 import IdInfo          -- quite a few things
 import StdIdInfo
 import Name            ( mkWiredInIdName, Name )
-import PrimOp          ( primOpInfo, tagOf_PrimOp, primOp_str,
-                         PrimOpInfo(..), PrimOpResultInfo(..), PrimOp )
+import PrimOp          ( primOpInfo, tagOf_PrimOp, PrimOpInfo(..), PrimOp )
 import PrelMods                ( pREL_GHC )
-import Type            ( mkForAllTys, mkFunTy, mkFunTys, mkTyVarTy, mkTyConApp )
+import Type            ( mkForAllTys, mkFunTy, mkFunTys, mkTyConApp )
 import TysWiredIn      ( boolTy )
 import Unique          ( mkPrimOpIdUnique )
 import Util            ( panic )
index 9951f98..ac47387 100644 (file)
@@ -57,11 +57,11 @@ module Name (
 import {-# SOURCE #-} Id    ( Id )
 import {-# SOURCE #-} TyCon ( TyCon )
 
-import CStrings                ( identToC, modnameToC, cSEP )
+import CStrings                ( identToC )
 import CmdLineOpts     ( opt_PprStyle_All, opt_OmitInterfacePragmas, opt_EnsureSplittableC )
 import BasicTypes      ( Module, IfaceFlavour(..), moduleString, pprModule )
 
-import Lex             ( isLexSym, isLexConId )
+import Lex             ( isLexConId )
 import SrcLoc          ( noSrcLoc, mkBuiltinSrcLoc, SrcLoc )
 import Unique          ( pprUnique, showUnique, Unique, Uniquable(..) )
 import UniqSet         ( UniqSet(..), emptyUniqSet, unitUniqSet, unionUniqSets, uniqSetToList, 
@@ -558,14 +558,12 @@ class NamedThing a where
 
 \begin{code}
 modAndOcc          :: NamedThing a => a -> (Module, OccName)
-getModule          :: NamedThing a => a -> Module
 getSrcLoc          :: NamedThing a => a -> SrcLoc
 isLocallyDefined    :: NamedThing a => a -> Bool
 isExported         :: NamedThing a => a -> Bool
 getOccString       :: NamedThing a => a -> String
 
 modAndOcc          = nameModAndOcc        . getName
-getModule          = nameModule           . getName
 isExported         = isExportedName       . getName
 getSrcLoc          = nameSrcLoc           . getName
 isLocallyDefined    = isLocallyDefinedName . getName
index 23bd2c0..4b83b52 100644 (file)
@@ -24,10 +24,12 @@ module UniqSupply (
 import Unique
 import Util
 
-
 import GlaExts
-import IOBase  ( IO(..), IOResult(..) )
-import PrelBase ( Char(..) )
+
+#if __GLASGOW_HASKELL__ < 301
+import IOBase          ( IO(..), IOResult(..) )
+#else
+#endif
 
 w2i x = word2Int# x
 i2w x = int2Word# x
index c6b6f0a..44a0612 100644 (file)
@@ -638,7 +638,6 @@ errorIdKey                = mkPreludeMiscIdUnique  7
 foldlIdKey                   = mkPreludeMiscIdUnique  8
 foldrIdKey                   = mkPreludeMiscIdUnique  9
 forkIdKey                    = mkPreludeMiscIdUnique 10
-int2IntegerIdKey             = mkPreludeMiscIdUnique 11
 integerMinusOneIdKey         = mkPreludeMiscIdUnique 12
 integerPlusOneIdKey          = mkPreludeMiscIdUnique 13
 integerPlusTwoIdKey          = mkPreludeMiscIdUnique 14
index 596a7c2..a6fe32d 100644 (file)
@@ -53,11 +53,11 @@ module CoreSyn (
 
 #include "HsVersions.h"
 
-import CostCentre      ( showCostCentre, CostCentre )
+import CostCentre      ( CostCentre )
 import Id              ( idType, GenId{-instance Eq-}, Id )
 import Type            ( isUnboxedType,GenType, Type )
 import TyVar           ( GenTyVar, TyVar )
-import Util            ( panic, assertPanic {-pprTrace:ToDo:rm-} )
+import Util            ( panic, assertPanic )
 import BinderInfo       ( BinderInfo )
 import BasicTypes      ( Unused )
 import Literal          ( Literal )
index c92ffe6..31276b6 100644 (file)
@@ -15,14 +15,14 @@ find, unsurprisingly, a Core expression.
 \begin{code}
 module CoreUnfold (
        SimpleUnfolding(..), Unfolding(..), UnfoldingGuidance(..), -- types
-       UfExpr, RdrName, -- For closure (delete in 1.3)
 
-       FormSummary(..), mkFormSummary, whnfOrBottom, exprSmallEnoughToDup, exprIsTrivial,
+       FormSummary(..), mkFormSummary, whnfOrBottom, exprSmallEnoughToDup, 
+       exprIsTrivial,
 
        noUnfolding, mkMagicUnfolding, mkUnfolding, getUnfoldingTemplate,
 
-       smallEnoughToInline, couldBeSmallEnoughToInline, certainlySmallEnoughToInline,
-       inlineUnconditionally,
+       smallEnoughToInline, couldBeSmallEnoughToInline, 
+       certainlySmallEnoughToInline, inlineUnconditionally,
 
        calcUnfoldingGuidance,
 
@@ -33,8 +33,6 @@ module CoreUnfold (
 
 import {-# SOURCE #-} MagicUFs ( MagicUnfoldingFun, mkMagicUnfoldingFun )
 
-import Bag             ( emptyBag, unitBag, unionBags, Bag )
-
 import CmdLineOpts     ( opt_UnfoldingCreationThreshold,
                          opt_UnfoldingUseThreshold,
                          opt_UnfoldingConDiscount,
@@ -49,23 +47,17 @@ import BinderInfo   ( BinderInfo, isOneFunOcc, isOneSafeFunOcc
 import PragmaInfo      ( PragmaInfo(..) )
 import CoreSyn
 import CoreUtils       ( unTagBinders )
-import HsCore          ( UfExpr )
-import RdrHsSyn                ( RdrName )
 import OccurAnal       ( occurAnalyseGlobalExpr )
 import CoreUtils       ( coreExprType )
 import Id              ( Id, idType, getIdArity,  isBottomingId, isDataCon,
                          idWantsToBeINLINEd, idMustBeINLINEd, idMustNotBeINLINEd,
                          IdSet, GenId{-instances-} )
-import PrimOp          ( primOpCanTriggerGC, fragilePrimOp, PrimOp(..) )
-import IdInfo          ( ArityInfo(..), bottomIsGuaranteed )
-import Literal         ( isNoRepLit, isLitLitLit )
+import PrimOp          ( fragilePrimOp, primOpCanTriggerGC )
+import IdInfo          ( ArityInfo(..) )
+import Literal         ( isNoRepLit )
 import TyCon           ( tyConFamilySize )
 import Type            ( splitAlgTyConApp_maybe )
 import Unique           ( Unique )
-import UniqSet         ( emptyUniqSet, unitUniqSet, mkUniqSet,
-                         addOneToUniqSet, unionUniqSets
-                       )
-import Maybes          ( maybeToBool )
 import Util            ( isIn, panic, assertPanic )
 import Outputable
 \end{code}
index bfc21df..1ecaadf 100644 (file)
@@ -29,7 +29,7 @@ import Id             ( idType, mkSysLocal, isBottomingId,
                          addOneToIdEnv, growIdEnvList, lookupIdEnv,
                          isNullIdEnv, IdEnv, Id
                        )
-import Literal         ( literalType, isNoRepLit, Literal(..) )
+import Literal         ( literalType, Literal(..) )
 import Maybes          ( catMaybes, maybeToBool )
 import PprCore
 import PrimOp          ( primOpType, PrimOp(..) )
@@ -46,7 +46,7 @@ import Type           ( mkFunTy, mkForAllTy, mkTyVarTy,
 import TysWiredIn      ( trueDataCon, falseDataCon )
 import Unique          ( Unique )
 import BasicTypes      ( Unused )
-import UniqSupply      ( initUs, returnUs, thenUs,
+import UniqSupply      ( returnUs, thenUs,
                          mapUs, mapAndUnzipUs, getUnique,
                          UniqSM, UniqSupply
                        )
index 0c29fa0..9eeadaf 100644 (file)
@@ -17,13 +17,11 @@ module PprCore (
 
 import CoreSyn
 import CostCentre      ( showCostCentre )
-import Id              ( idType, getIdInfo, getIdStrictness, isTupleCon,
-                         nullIdEnv, DataCon, GenId{-instances-},
-                         Id
+import Id              ( idType, getIdInfo, isTupleCon,
+                         DataCon, GenId{-instances-}, Id
                        ) 
 import IdInfo          ( ppIdInfo, ppStrictnessInfo )
 import Literal         ( Literal{-instances-} )
-import Name            ( OccName )
 import Outputable      -- quite a few things
 import PprEnv
 import PprType         ( pprParendGenType, pprTyVarBndr, GenType{-instances-}, GenTyVar{-instance-} )
index d020b76..b557803 100644 (file)
@@ -14,13 +14,12 @@ import {-# SOURCE #-} HsExpr    ( pprExpr, HsExpr )
 import {-# SOURCE #-} HsMatches ( pprMatches, Match, pprGRHSsAndBinds, GRHSsAndBinds )
 
 -- friends:
-import HsPragmas       ( GenPragmas, ClassOpPragmas )
 import HsTypes         ( HsType )
 import CoreSyn         ( CoreExpr )
 import PprCore         ()         -- Instances for Outputable
 
 --others:
-import Id              ( DictVar, Id, GenId )
+import Id              ( Id, GenId )
 import Name            ( OccName, NamedThing(..) )
 import BasicTypes      ( RecFlag(..) )
 import Outputable      
index 05226a1..53d16be 100644 (file)
@@ -21,9 +21,7 @@ module HsCore (
 
 -- friends:
 import HsTypes         ( HsType, pprParendHsType )
-import PrimOp          ( PrimOp, tagOf_PrimOp )
 import Kind            ( Kind {- instance Outputable -} )
-import Type            ( GenType {- instance Outputable -} )
 
 -- others:
 import Literal         ( Literal )
index f466d59..ce68cef 100644 (file)
@@ -13,9 +13,7 @@ module HsDecls where
 
 -- friends:
 import HsBinds         ( HsBinds, MonoBinds, Sig, nullMonoBinds )
-import HsPragmas       ( DataPragmas, ClassPragmas,
-                         InstancePragmas, ClassOpPragmas
-                       )
+import HsPragmas       ( DataPragmas, ClassPragmas )
 import HsTypes
 import HsCore          ( UfExpr )
 import BasicTypes      ( Fixity, NewOrData(..) )
index 8e89bb2..ffbd373 100644 (file)
@@ -214,8 +214,6 @@ pprOutPat (DictPat dicts methods)
                  brackets (interpp'SP dicts),
                  brackets (interpp'SP methods)])
 
-pprConPatTy ty
- = parens (ppr ty)
 \end{code}
 
 %************************************************************************
index 418c150..c2aed36 100644 (file)
@@ -16,10 +16,6 @@ module HsPragmas where
 
 #include "HsVersions.h"
 
--- friends:
-import HsTypes         ( HsType )
-
--- others:
 import IdInfo
 import Outputable
 \end{code}
@@ -60,179 +56,3 @@ instance Outputable name => Outputable (InstancePragmas name) where
 instance Outputable name => Outputable (GenPragmas name) where
     ppr NoGenPragmas = empty
 \end{code}
-
-========================= OLD CODE SCEDULED FOR DELETION SLPJ Nov 96 ==============
-
-\begin{code}
-{-             COMMENTED OUT 
-
-Certain pragmas expect to be pinned onto certain constructs.
-
-Pragma types may be parameterised, just as with any other
-abstract-syntax type.
-
-For a @data@ declaration---indicates which specialisations exist.
-\begin{code}
-data DataPragmas name
-  = NoDataPragmas
-  | DataPragmas        [[Maybe (HsType name)]]  -- types to which specialised
-
-noDataPragmas = NoDataPragmas
-isNoDataPragmas NoDataPragmas = True
-\end{code}
-
-These are {\em general} things you can know about any value:
-\begin{code}
-data GenPragmas name
-  = NoGenPragmas
-  | GenPragmas (Maybe Int)             -- arity (maybe)
-               (Maybe UpdateInfo)      -- update info (maybe)
-               (ImpStrictness name)    -- strictness, worker-wrapper
-               (ImpUnfolding name)     -- unfolding (maybe)
-               [([Maybe (HsType name)], -- Specialisations: types to which spec'd;
-                 Int,                     -- # dicts to ignore
-                 GenPragmas name)]        -- Gen info about the spec'd version
-
-noGenPragmas = NoGenPragmas
-
-isNoGenPragmas NoGenPragmas = True
-isNoGenPragmas _            = False
-
-data ImpUnfolding name
-  = NoImpUnfolding
-  | ImpMagicUnfolding FAST_STRING      -- magic "unfolding"
-                                       -- known to the compiler by "String"
-  | ImpUnfolding UnfoldingGuidance     -- always, if you like, etc.
-                (UnfoldingCoreExpr name)
-
-data ImpStrictness name
-  = NoImpStrictness
-  | ImpStrictness Bool                 -- True <=> bottoming Id
-                 [Demand]              -- demand info
-                 (GenPragmas name)     -- about the *worker*
-\end{code}
-
-For an ordinary imported function: it can have general pragmas (only).
-
-For a class's super-class dictionary selectors:
-\begin{code}
-data ClassPragmas name
-  = NoClassPragmas
-  | SuperDictPragmas [GenPragmas name] -- list mustn't be empty
-
-noClassPragmas = NoClassPragmas
-
-isNoClassPragmas NoClassPragmas = True
-isNoClassPragmas _              = False
-\end{code}
-
-For a class's method selectors:
-\begin{code}
-data ClassOpPragmas name
-  = NoClassOpPragmas
-  | ClassOpPragmas  (GenPragmas name) -- for method selector
-                   (GenPragmas name) -- for default method
-
-
-noClassOpPragmas = NoClassOpPragmas
-
-isNoClassOpPragmas NoClassOpPragmas = True
-isNoClassOpPragmas _                = False
-\end{code}
-
-\begin{code}
-data InstancePragmas name
-  = NoInstancePragmas
-
-  | SimpleInstancePragma          -- nothing but for the dfun itself...
-       (GenPragmas name)
-
-  | ConstantInstancePragma
-       (GenPragmas name)          -- for the "dfun" itself
-       [(name, GenPragmas name)]  -- one per class op
-
-  | SpecialisedInstancePragma
-       (GenPragmas name)          -- for its "dfun"
-       [([Maybe (HsType name)], -- specialised instance; type...
-         Int,                     -- #dicts to ignore
-         InstancePragmas name)]   -- (no SpecialisedInstancePragma please!)
-
-noInstancePragmas = NoInstancePragmas
-
-isNoInstancePragmas NoInstancePragmas = True
-isNoInstancePragmas _                 = False
-\end{code}
-
-Some instances for printing (just for debugging, really)
-\begin{code}
-instance Outputable name => Outputable (ClassPragmas name) where
-    ppr NoClassPragmas = empty
-    ppr (SuperDictPragmas sdsel_prags)
-      = ($$) (ptext SLIT("{-superdict pragmas-}"))
-               (ppr sdsel_prags)
-
-instance Outputable name => Outputable (ClassOpPragmas name) where
-    ppr NoClassOpPragmas = empty
-    ppr (ClassOpPragmas op_prags defm_prags)
-      = ($$) (hsep [ptext SLIT("{-meth-}"), ppr op_prags])
-               (hsep [ptext SLIT("{-defm-}"), ppr defm_prags])
-
-instance Outputable name => Outputable (InstancePragmas name) where
-    ppr NoInstancePragmas = empty
-    ppr (SimpleInstancePragma dfun_pragmas)
-      = hsep [ptext SLIT("{-dfun-}"), ppr dfun_pragmas]
-    ppr (ConstantInstancePragma dfun_pragmas name_pragma_pairs)
-      = ($$) (hsep [ptext SLIT("{-constm-}"), ppr dfun_pragmas])
-               (vcat (map pp_pair name_pragma_pairs))
-      where
-       pp_pair (n, prags)
-         = hsep [ppr n, equals, ppr prags]
-
-    ppr (SpecialisedInstancePragma dfun_pragmas spec_pragma_info)
-      = ($$) (hsep [ptext SLIT("{-spec'd-}"), ppr dfun_pragmas])
-               (vcat (map pp_info spec_pragma_info))
-      where
-       pp_info (ty_maybes, num_dicts, prags)
-         = hcat [brackets (hsep (map pp_ty ty_maybes)),
-                      parens (int num_dicts), equals, ppr prags]
-       pp_ty Nothing = ptext SLIT("_N_")
-       pp_ty (Just t)= ppr t
-
-instance Outputable name => Outputable (GenPragmas name) where
-    ppr NoGenPragmas = empty
-    ppr (GenPragmas arity_maybe upd_maybe def strictness unfolding specs)
-      = hsep [pp_arity arity_maybe, pp_upd upd_maybe, -- ToDo: print def?
-              pp_str strictness, pp_unf unfolding,
-              pp_specs specs]
-      where
-       pp_arity Nothing  = empty
-       pp_arity (Just i) = (<>) (ptext SLIT("ARITY=")) (int i)
-
-       pp_upd Nothing  = empty
-       pp_upd (Just u) = ppUpdateInfo u
-
-       pp_str NoImpStrictness = empty
-       pp_str (ImpStrictness is_bot demands wrkr_prags)
-         = hcat [ptext SLIT("IS_BOT="), ppr is_bot,
-                      ptext SLIT("STRICTNESS="), text (showList demands ""),
-                      ptext SLIT(" {"), ppr wrkr_prags, char '}']
-
-       pp_unf NoImpUnfolding = ptext SLIT("NO_UNFOLDING")
-       pp_unf (ImpMagicUnfolding m) = (<>) (ptext SLIT("MAGIC=")) (ptext m)
-       pp_unf (ImpUnfolding g core) = (<>) (ptext SLIT("UNFOLD=")) (ppr core)
-
-       pp_specs [] = empty
-       pp_specs specs
-         = hcat [ptext SLIT("SPECS=["), hsep (map pp_spec specs), char ']']
-         where
-           pp_spec (ty_maybes, num_dicts, gprags)
-             = hsep [brackets (hsep (map pp_MaB ty_maybes)), int num_dicts, ppr gprags]
-
-           pp_MaB Nothing  = ptext SLIT("_N_")
-           pp_MaB (Just x) = ppr x
-\end{code}
-
-
-\begin{code}
--}
-\end{code}
index 759251b..e2b1354 100644 (file)
@@ -23,8 +23,7 @@ module HsTypes (
 
 import Outputable
 import Kind            ( Kind {- instance Outputable -} )
-import Name            ( nameOccName )
-import Util            ( thenCmp, cmpList, isIn, panic )
+import Util            ( thenCmp, cmpList, panic )
 import GlaExts         ( Int#, (<#) )
 \end{code}
 
index 7b1a71d..c9278fe 100644 (file)
@@ -105,12 +105,17 @@ module CmdLineOpts (
 
 import Array   ( array, (//) )
 import GlaExts
-import ArrBase
 import Argv
 import Constants       -- Default values for some flags
 
 import Maybes          ( assocMaybe, firstJust, maybeToBool )
-import Util            ( startsWith, panic, panic#, assertPanic )
+import Util            ( startsWith, panic, panic# )
+
+#if __GLASGOW_HASKELL__ < 301
+import ArrBase ( Array(..) )
+#else
+import PrelArr  ( Array(..) )
+#endif
 \end{code}
 
 A command-line {\em switch} is (generally) either on or off; e.g., the
@@ -588,15 +593,6 @@ switchIsOn lookup_fn switch
       SwBool False -> False
       _                   -> True
 
-stringSwitchSet :: (switch -> SwitchResult)
-               -> (FAST_STRING -> switch)
-               -> Maybe FAST_STRING
-
-stringSwitchSet lookup_fn switch
-  = case (lookup_fn (switch (panic "stringSwitchSet"))) of
-      SwString str -> Just str
-      _                   -> Nothing
-
 intSwitchSet :: (switch -> SwitchResult)
             -> (Int -> switch)
             -> Maybe Int
index 10bcca3..c73b6ce 100644 (file)
@@ -12,8 +12,6 @@ module UgenUtil (
 
 import GlaExts
 import Name
-import RdrHsSyn                ( RdrName(..) )
-import BasicTypes      ( IfaceFlavour )
 import SrcLoc          ( mkSrcLoc, noSrcLoc, SrcLoc )
 import FastString      ( FastString, mkFastCharString, mkFastCharString2 )
 \end{code}
index f4f3cab..de1a41e 100644 (file)
@@ -171,18 +171,6 @@ data_tycons
     , voidTyCon
     , wordTyCon
     ]
-
-min_nonprim_tycon_list         -- used w/ HideMostBuiltinNames
-  = [ boolTyCon
-    , charTyCon
-    , intTyCon
-    , floatTyCon
-    , doubleTyCon
-    , integerTyCon
-    , liftTyCon
-    , return2GMPsTyCon -- ADR asked for these last two (WDP 94/11)
-    , returnIntAndGMPTyCon
-    ]
 \end{code}
 
 %************************************************************************
index 9f6930b..4d36604 100644 (file)
@@ -8,9 +8,9 @@ module PrelVals where
 
 #include "HsVersions.h"
 
-import {-# SOURCE #-} CoreUnfold ( UnfoldingGuidance(..), mkUnfolding )
+import {-# SOURCE #-} CoreUnfold ( mkUnfolding )
 
-import Id              ( Id, mkImported, mkTemplateLocals )
+import Id              ( Id, mkImported )
 import SpecEnv         ( SpecEnv, emptySpecEnv )
 
 -- friends:
@@ -19,15 +19,12 @@ import TysPrim
 import TysWiredIn
 
 -- others:
-import CmdLineOpts     ( maybe_CompilingGhcInternals )
 import CoreSyn         -- quite a bit
 import IdInfo          -- quite a bit
-import Literal         ( mkMachInt )
 import Name            ( mkWiredInIdName, Module )
 import PragmaInfo
-import PrimOp          ( PrimOp(..) )
 import Type            
-import TyVar           ( openAlphaTyVar, alphaTyVar, betaTyVar, gammaTyVar, TyVar )
+import TyVar           ( openAlphaTyVar, alphaTyVar, betaTyVar, TyVar )
 import Unique          -- lots of *Keys
 import Util            ( panic )
 \end{code}
index 58c2811..f9fe248 100644 (file)
@@ -35,7 +35,7 @@ import Id             ( GenId, mkTemplateLocals, idType,
                        )
 import IdInfo          ( ArityInfo, exactArity )
 import Class           ( classBigSig, classTyCon )
-import TyCon           ( isNewTyCon, isDataTyCon, isAlgTyCon, tyConDataCons )
+import TyCon           ( isNewTyCon, tyConDataCons )
 import FieldLabel      ( FieldLabel )
 import PrelVals                ( pAT_ERROR_ID )
 import Maybes
index 37ad832..7a8796a 100644 (file)
@@ -11,7 +11,7 @@ module TysPrim where
 
 #include "HsVersions.h"
 
-import Kind            ( mkUnboxedTypeKind, mkBoxedTypeKind, mkTypeKind, mkArrowKind )
+import Kind            ( mkBoxedTypeKind )
 import Name            ( mkWiredInTyConName )
 import PrimRep         ( PrimRep(..) ) -- getPrimRepInfo uses PrimRep repn
 import TyCon           ( mkPrimTyCon, mkDataTyCon, TyCon )
index 4d1cfcd..a1478da 100644 (file)
@@ -28,9 +28,9 @@ module CostCentre (
 
 #include "HsVersions.h"
 
-import Id              ( externallyVisibleId, GenId, showId, Id )
+import Id              ( externallyVisibleId, GenId, Id )
 import CStrings                ( identToC, stringToC )
-import Name            ( OccName, getOccString, moduleString, nameString )
+import Name            ( OccName, getOccString, moduleString )
 import Outputable      
 import Util            ( panic, panic#, assertPanic, thenCmp )
 
@@ -497,7 +497,6 @@ uppCostCentreDecl is_local cc
       where
        cc_IS_CAF      = "CC_IS_CAF"
        cc_IS_DICT     = "CC_IS_DICT"
-       cc_IS_SUBSUMED = "CC_IS_SUBSUMED"
        cc_IS_BORING   = "CC_IS_BORING"
 
        do_caf IsCafCC       = cc_IS_CAF
index b312655..5ce4cc7 100644 (file)
@@ -32,7 +32,7 @@ module Lex (
 
 #include "HsVersions.h"
 
-import Char            (isDigit, isAlpha, isAlphanum, isUpper,isLower, isSpace, ord )
+import Char            (isDigit, isAlphanum, isUpper,isLower, isSpace, ord )
 
 import {-# SOURCE #-} CostCentre
 
index 5cd65dd..922fe48 100644 (file)
@@ -56,13 +56,10 @@ module RdrHsSyn (
 
 import HsSyn
 import Lex
-import PrelMods                ( pRELUDE )
-import BasicTypes      ( Module(..), NewOrData, IfaceFlavour(..), Unused )
-import Name            ( ExportFlag(..), pprModule,
-                         OccName(..), pprOccName, 
+import BasicTypes      ( Module(..), IfaceFlavour(..), Unused )
+import Name            ( pprModule, OccName(..), pprOccName, 
                          prefixOccName, NamedThing )
 import Util            ( thenCmp )
-import CoreSyn         ( GenCoreExpr )
 import HsPragmas       ( GenPragmas, ClassPragmas, DataPragmas, ClassOpPragmas, InstancePragmas )
 import List            ( nub )
 import Outputable
index 0cb23f0..e221088 100644 (file)
@@ -9,10 +9,10 @@ module Rename ( renameModule ) where
 #include "HsVersions.h"
 
 import HsSyn
-import RdrHsSyn                ( RdrName(..), RdrNameHsModule, RdrNameImportDecl )
+import RdrHsSyn                ( RdrName(..), RdrNameHsModule )
 import RnHsSyn         ( RenamedHsModule, RenamedHsDecl, extractHsTyNames )
 
-import CmdLineOpts     ( opt_HiMap, opt_WarnNameShadowing, opt_D_show_rn_trace,
+import CmdLineOpts     ( opt_HiMap, opt_D_show_rn_trace,
                          opt_D_dump_rn, opt_D_show_rn_stats,
                          opt_WarnUnusedBinds, opt_WarnUnusedImports
                        )
@@ -23,11 +23,9 @@ import RnIfaces              ( getImportedInstDecls, importDecl, getImportVersions, getSpeci
                          getDeferredDataDecls,
                          mkSearchPath, getSlurpedNames, getRnStats
                        )
-import RnEnv           ( availsToNameSet, addAvailToNameSet,
-                         addImplicitOccsRn, lookupImplicitOccRn )
-import Name            ( Name, PrintUnqualified, Provenance, ExportFlag(..), 
-                         isLocallyDefined,
-                         NameSet(..), elemNameSet, mkNameSet, unionNameSets, 
+import RnEnv           ( addImplicitOccsRn )
+import Name            ( Name, PrintUnqualified, Provenance, isLocallyDefined,
+                         NameSet(..),
                          nameSetToList, minusNameSet, NamedThing(..),
                          nameModule, pprModule, pprOccName, nameOccName
                        )
@@ -38,7 +36,6 @@ import PrelInfo               ( ioTyCon_NAME )
 import ErrUtils                ( pprBagOfErrors, pprBagOfWarnings,
                          doIfSet, dumpIfSet, ghcExit
                        )
-import FiniteMap       ( emptyFM, eltsFM, fmToList, addToFM, FiniteMap )
 import Bag             ( isEmptyBag )
 import UniqSupply      ( UniqSupply )
 import Util            ( equivClasses )
index 4a7bd54..92e221e 100644 (file)
@@ -20,7 +20,6 @@ module RnBinds (
 import {-# SOURCE #-} RnSource ( rnHsSigType )
 
 import HsSyn
-import HsPragmas       ( isNoGenPragmas, noGenPragmas )
 import RdrHsSyn
 import RnHsSyn
 import RnMonad
@@ -36,8 +35,7 @@ import Name           ( OccName(..), Provenance,
                          minusNameSet, unionManyNameSets, elemNameSet, unitNameSet, nameSetToList
                        )
 import BasicTypes      ( RecFlag(..), TopLevelFlag(..) )
-import Maybes          ( catMaybes )
-import Util            ( thenCmp, isIn, removeDups, panic, panic#, assertPanic, assocDefault )
+import Util            ( thenCmp, removeDups, panic, panic#, assertPanic )
 import UniqSet         ( UniqSet )
 import ListSetOps      ( minusList )
 import Bag             ( bagToList )
index 664fa70..c41b0bd 100644 (file)
@@ -12,25 +12,23 @@ import CmdLineOpts  ( opt_WarnNameShadowing, opt_WarnUnusedMatches,
                          opt_WarnUnusedBinds, opt_WarnUnusedImports )
 import HsSyn
 import RdrHsSyn                ( RdrName(..), RdrNameIE,
-                         rdrNameOcc, ieOcc, isQual, qual
+                         rdrNameOcc, isQual, qual
                        )
 import HsTypes         ( getTyVarName, replaceTyVarName )
-import BasicTypes      ( Fixity(..), FixityDirection(..), IfaceFlavour(..), pprModule )
+import BasicTypes      ( Fixity(..), FixityDirection(..), IfaceFlavour(..) )
 import RnMonad
 import Name            ( Name, OccName(..), Provenance(..), ExportFlag(..), NamedThing(..),
-                         occNameString, occNameFlavour, getSrcLoc,
+                         occNameFlavour, getSrcLoc,
                          NameSet, emptyNameSet, addListToNameSet, nameSetToList,
                          mkLocalName, mkGlobalName, modAndOcc,
                          nameOccName, setNameProvenance, isVarOcc, getNameProvenance,
-                         pprProvenance, pprOccName, pprModule, pprNameProvenance,
-                         isLocalName
+                         pprOccName, isLocalName
                        )
 import TyCon           ( TyCon )
-import TysWiredIn      ( tupleTyCon, listTyCon, charTyCon, intTyCon )
+import TysWiredIn      ( tupleTyCon, listTyCon, charTyCon )
 import FiniteMap
 import Unique          ( Unique, Uniquable(..), unboundKey )
 import UniqFM           ( listToUFM, plusUFM_C )
-import Maybes          ( maybeToBool )
 import UniqSupply
 import SrcLoc          ( SrcLoc, noSrcLoc )
 import Outputable
index 165555e..4a7bd22 100644 (file)
@@ -37,11 +37,8 @@ import TysPrim               ( charPrimTyCon, addrPrimTyCon, intPrimTyCon,
                          floatPrimTyCon, doublePrimTyCon
                        )
 import Name
-import UniqFM          ( lookupUFM, {- ToDo:rm-} isNullUFM )
-import UniqSet         ( emptyUniqSet, unitUniqSet,
-                         unionUniqSets, unionManyUniqSets,
-                         UniqSet
-                       )
+import UniqFM          ( isNullUFM )
+import UniqSet         ( emptyUniqSet, unionManyUniqSets, UniqSet )
 import Util            ( removeDups )
 import Outputable
 \end{code}
index f5e5e77..fc92aca 100644 (file)
@@ -26,25 +26,24 @@ import HsSyn                ( HsDecl(..), TyDecl(..), ClassDecl(..), InstDecl(..), IfaceSig(..
                          HsType(..), ConDecl(..), IE(..), ConDetails(..), Sig(..),
                          hsDeclName
                        )
-import HsPragmas       ( noGenPragmas )
 import BasicTypes      ( Version, NewOrData(..), IfaceFlavour(..) )
 import RdrHsSyn                ( RdrNameHsDecl, RdrNameInstDecl, RdrNameTyDecl,
                          RdrName(..), rdrNameOcc
                        )
-import RnEnv           ( newImportedGlobalName, addImplicitOccsRn, ifaceFlavour,
-                         availName, availNames, addAvailToNameSet, pprAvail
+import RnEnv           ( newImportedGlobalName, addImplicitOccsRn,
+                         ifaceFlavour, availName, availNames, addAvailToNameSet
                        )
 import RnSource                ( rnHsSigType )
 import RnMonad
 import RnHsSyn          ( RenamedHsDecl )
 import ParseIface      ( parseIface, IfaceStuff(..) )
 
-import FiniteMap       ( FiniteMap, sizeFM, emptyFM, unitFM,  delFromFM,
+import FiniteMap       ( FiniteMap, sizeFM, emptyFM, delFromFM,
                          lookupFM, addToFM, addToFM_C, addListToFM, 
-                         fmToList, eltsFM 
+                         fmToList
                        )
 import Name            ( Name {-instance NamedThing-}, Provenance, OccName(..),
-                         nameModule, occNameString, moduleString, pprModule, isLocallyDefined,
+                         nameModule, moduleString, pprModule, isLocallyDefined,
                          NameSet(..), emptyNameSet, unionNameSets, nameSetToList,
                          minusNameSet, mkNameSet, elemNameSet, nameUnique, addOneToNameSet,
                          isWiredInName, maybeWiredInTyConName, maybeWiredInIdName,
@@ -58,11 +57,11 @@ import SrcLoc               ( mkSrcLoc, SrcLoc )
 import PrelMods                ( pREL_GHC )
 import PrelInfo                ( cCallishTyKeys )
 import Bag
-import Maybes          ( MaybeErr(..), expectJust, maybeToBool )
+import Maybes          ( MaybeErr(..), maybeToBool )
 import ListSetOps      ( unionLists )
 import Outputable
 import Unique          ( Unique )
-import StringBuffer     ( StringBuffer, hGetStringBuffer, freeStringBuffer )
+import StringBuffer     ( StringBuffer, hGetStringBuffer )
 import FastString      ( mkFastString )
 import Outputable
 
index f8cf4b1..f69ebb3 100644 (file)
@@ -23,7 +23,6 @@ import RdrHsSyn       ( RdrNameHsDecl(..), RdrName(..), RdrNameIE(..), RdrNameImportDe
                  RdrNameHsModule, RdrNameFixityDecl,
                  rdrNameOcc, ieOcc
                )
-import RnHsSyn ( RenamedHsModule(..), RenamedFixityDecl(..) )
 import RnIfaces        ( getInterfaceExports, getDeclBinders, recordSlurp, checkUpToDate )
 import BasicTypes ( IfaceFlavour(..) )
 import RnEnv
@@ -31,9 +30,9 @@ import RnMonad
 
 import FiniteMap
 import PrelMods
-import UniqFM  ( UniqFM, emptyUFM, addListToUFM_C, lookupUFM )
+import UniqFM  ( UniqFM, addListToUFM_C, lookupUFM )
 import Bag     ( Bag, bagToList )
-import Maybes  ( maybeToBool, expectJust )
+import Maybes  ( maybeToBool )
 import Name
 import Outputable
 import Util    ( removeDups )
index 4a64569..cb5abf3 100644 (file)
@@ -25,23 +25,17 @@ import RnEnv                ( bindTyVarsRn, lookupBndrRn, lookupOccRn, lookupImplicitOccRn, bi
                          listType_RDR, tupleType_RDR )
 import RnMonad
 
-import Name            ( Name, isLocallyDefined, 
-                         OccName(..), occNameString, prefixOccName,
-                         ExportFlag(..),
-                         Provenance(..), getNameProvenance,
-                         NameSet, unionNameSets, emptyNameSet, mkNameSet, unitNameSet,
-                         elemNameSet, nameSetToList
+import Name            ( Name, OccName(..), occNameString, prefixOccName,
+                         ExportFlag(..), Provenance(..), NameSet,
+                         elemNameSet
                        )
-import FiniteMap       ( emptyFM, lookupFM, addListToFM_C )
+import FiniteMap       ( lookupFM )
 import Id              ( GenId{-instance NamedThing-} )
-import IdInfo          ( IdInfo, StrictnessInfo(..), FBTypeInfo, DemandInfo, ArgUsageInfo )
+import IdInfo          ( FBTypeInfo, ArgUsageInfo )
 import Lex             ( isLexCon )
-import CoreUnfold      ( Unfolding(..), SimpleUnfolding )
-import MagicUFs                ( MagicUnfoldingFun )
 import PrelInfo                ( derivingOccurrences, evalClass_RDR, numClass_RDR, allClass_NAME )
-import ListSetOps      ( unionLists, minusList )
-import Maybes          ( maybeToBool, catMaybes )
-import Bag             ( emptyBag, unitBag, consBag, unionManyBags, unionBags, listToBag, bagToList )
+import Maybes          ( maybeToBool )
+import Bag             ( bagToList )
 import Outputable
 import SrcLoc          ( SrcLoc )
 import Unique          ( Unique )
index 61ade10..7a4ca18 100644 (file)
@@ -20,11 +20,11 @@ module OccurAnal (
 import BinderInfo
 import CmdLineOpts     ( opt_D_dump_occur_anal, SimplifierSwitch(..) )
 import CoreSyn
-import Digraph         ( stronglyConnComp, stronglyConnCompR, SCC(..) )
+import Digraph         ( stronglyConnCompR, SCC(..) )
 import Id              ( idWantsToBeINLINEd, addNoInlinePragma, nukeNoInlinePragma,
                          idType, idUnique, Id,
                          emptyIdSet, unionIdSets, mkIdSet,
-                         unitIdSet, elementOfIdSet,
+                         elementOfIdSet,
                          addOneToIdSet, IdSet,
                          nullIdEnv, unitIdEnv, combineIdEnvs,
                          delOneFromIdEnv, delManyFromIdEnv, isNullIdEnv, 
@@ -39,9 +39,8 @@ import PprType                ( GenType{-instance Outputable-}, GenTyVar{-ditto-} )
 import TyVar           ( GenTyVar{-instance Eq-} )
 import Unique          ( Unique{-instance Eq-}, u2i )
 import UniqFM          ( keysUFM )  
-import Util            ( assoc, zipEqual, zipWithEqual )
+import Util            ( zipWithEqual )
 import Outputable
-import List            ( partition )
 
 isSpecPragmaId_maybe x = Nothing -- ToDo:!trace "OccurAnal.isSpecPragmaId_maybe"
 \end{code}
@@ -101,10 +100,12 @@ keepUnusedBinding :: OccEnv -> Id -> Bool
 keepUnusedBinding (OccEnv keep_dead keep_spec keep_conjurable _ _ _) binder
   = keep_dead || (keep_spec && maybeToBool (isSpecPragmaId_maybe binder))
 
+{- UNUSED:
 keepBecauseConjurable :: OccEnv -> Id -> Bool
 keepBecauseConjurable (OccEnv _ _ keep_conjurable _ _ _) binder
   = False
     {- keep_conjurable && isConstMethodId binder -}
+-}
 
 type UsageDetails = IdEnv BinderInfo   -- A finite map from ids to their usage
 
@@ -330,8 +331,6 @@ It isn't easy to do a perfect job in one blow.  Consider
 occAnalBind env (Rec pairs) body_usage
   = foldr (_scc_ "occAnalBind.dofinal" do_final_bind) (body_usage, []) sccs
   where
-    pp_scc (CyclicSCC cycle) = hcat [text "Cyclic ", hcat (punctuate comma (map pp_item cycle))]
-    pp_scc (AcyclicSCC item) = hcat [text "Acyclic ", pp_item item]
     pp_item (_, bndr, _)     = ppr bndr
 
     binders = map fst pairs
index fb5d225..2487299 100644 (file)
@@ -53,21 +53,17 @@ import CmdLineOpts  ( switchIsOn, intSwitchSet, opt_UnfoldingCreationThreshold,
                        )
 import CoreSyn
 import CoreUnfold      ( mkFormSummary, couldBeSmallEnoughToInline, whnfOrBottom,
-                         Unfolding(..), UfExpr, RdrName,
-                         SimpleUnfolding(..), FormSummary(..),
-                         calcUnfoldingGuidance, UnfoldingGuidance(..)
-                       )
-import CoreUtils       ( coreExprCc, unTagBinders )
+                         Unfolding(..), SimpleUnfolding(..), FormSummary(..),
+                         calcUnfoldingGuidance )
+import CoreUtils       ( coreExprCc )
 import CostCentre      ( CostCentre, subsumedCosts, noCostCentreAttached )
 import FiniteMap       -- lots of things
-import Id              ( idType, getIdUnfolding, getIdStrictness, idWantsToBeINLINEd,
-                         applyTypeEnvToId, getInlinePragma,
-                         nullIdEnv, growIdEnvList, rngIdEnv, lookupIdEnv,
-                         addOneToIdEnv, modifyIdEnv, mkIdSet, modifyIdEnv_Directly,
+import Id              ( applyTypeEnvToId, getInlinePragma,
+                         nullIdEnv, growIdEnvList, lookupIdEnv,
+                         addOneToIdEnv, modifyIdEnv, modifyIdEnv_Directly,
                          IdEnv, IdSet, GenId, Id )
-import Literal         ( isNoRepLit, Literal{-instances-} )
-import Maybes          ( maybeToBool, expectJust )
-import Name            ( isLocallyDefined )
+import Literal         ( Literal{-instances-} )
+import Maybes          ( expectJust )
 import OccurAnal       ( occurAnalyseExpr )
 import PprCore         -- various instances
 import PprType         ( GenType, GenTyVar )
@@ -78,8 +74,7 @@ import TyVar          ( emptyTyVarEnv, plusTyVarEnv, addToTyVarEnv, growTyVarEnvList,
                        )
 import Unique          ( Unique{-instance Outputable-}, Uniquable(..) )
 import UniqFM          ( addToUFM, addToUFM_C, ufmToList )
-import Util            ( Eager, appEager, returnEager, runEager,
-                         zipEqual, thenCmp, cmpList )
+import Util            ( Eager, returnEager, zipEqual, thenCmp, cmpList )
 import Outputable
 \end{code}
 
index 168e467..194acef 100644 (file)
@@ -13,7 +13,7 @@ module SpecEnv (
 #include "HsVersions.h"
 
 import Type            ( Type, GenType, matchTys, tyVarsOfTypes )
-import TyVar           ( TyVar, TyVarEnv, lookupTyVarEnv, tyVarSetToList )
+import TyVar           ( TyVarEnv, lookupTyVarEnv, tyVarSetToList )
 import Unify           ( Subst, unifyTyListsX )
 import Maybes
 import Util            ( assertPanic )
index bd2ebe5..8ef584a 100644 (file)
@@ -15,11 +15,11 @@ module WwLib (
 
 import CoreSyn
 import Id              ( GenId, idType, mkSysLocal, dataConArgTys, isDataCon, isNewCon, Id )
-import IdInfo          ( mkStrictnessInfo, {-??nonAbsentArgs,-} Demand(..) )
+import IdInfo          ( Demand(..) )
 import PrelVals                ( aBSENT_ERROR_ID, voidId )
 import TysPrim         ( voidTy )
 import SrcLoc          ( noSrcLoc )
-import Type            ( isUnpointedType, mkTyVarTys, mkForAllTys, mkFunTys,
+import Type            ( isUnpointedType, mkTyVarTys, mkFunTys,
                          splitForAllTys, splitFunTys,
                          splitAlgTyConApp_maybe, 
                          Type
@@ -28,12 +28,9 @@ import TyCon         ( isNewTyCon, isDataTyCon )
 import BasicTypes      ( NewOrData(..) )
 import TyVar            ( TyVar )
 import PprType         ( GenType, GenTyVar )
-import UniqSupply      ( returnUs, thenUs, thenMaybeUs,
-                         getUniques, getUnique, UniqSM
-                       )
-import Util            ( zipWithEqual, zipEqual )
+import UniqSupply      ( returnUs, thenUs, getUniques, getUnique, UniqSM )
+import Util            ( zipEqual )
 import Outputable
-import List            ( nub )
 \end{code}
 
 %************************************************************************
index 6845415..9827cab 100644 (file)
@@ -17,14 +17,13 @@ module Class (
 
 #include "HsVersions.h"
 
-import {-# SOURCE #-} Id       ( Id, idType, idName )
+import {-# SOURCE #-} Id       ( Id )
 import {-# SOURCE #-} TyCon    ( TyCon )
 import {-# SOURCE #-} Type     ( Type )
 import {-# SOURCE #-} SpecEnv  ( SpecEnv )
 
 import TyCon           ( TyCon )
 import TyVar           ( TyVar )
-import Maybes          ( assocMaybe )
 import Name            ( NamedThing(..), Name, getOccName )
 import Unique          ( Unique, Uniquable(..) )
 import BasicTypes      ( Unused )
index a2048a5..0ce00b1 100644 (file)
@@ -40,7 +40,7 @@ module TyCon(
 
 import {-# SOURCE #-} Type  ( Type )
 import {-# SOURCE #-} Class ( Class )
-import {-# SOURCE #-} Id    ( Id, isNullaryDataCon, idType )
+import {-# SOURCE #-} Id    ( Id, isNullaryDataCon )
 import {-# SOURCE #-} TysWiredIn ( tupleCon )
 
 
@@ -53,11 +53,8 @@ import Maybes
 import Name            ( Name, nameUnique, mkWiredInTyConName, NamedThing(getName) )
 import Unique          ( Unique, funTyConKey, Uniquable(..) )
 import PrimRep         ( PrimRep(..), isFollowableRep )
-import PrelMods                ( pREL_GHC, pREL_TUP, pREL_BASE )
-import Lex             ( mkTupNameStr )
-import SrcLoc          ( SrcLoc, mkBuiltinSrcLoc )
-import Util            ( nOfThem, isIn )
-import Outputable
+import PrelMods                ( pREL_GHC )
+import Util            ( panic )
 \end{code}
 
 \begin{code}
index d84f41a..0b9b294 100644 (file)
@@ -56,8 +56,7 @@ import BasicTypes ( Unused )
 import Maybes  ( maybeToBool, assocMaybe )
 import PrimRep ( PrimRep(..) )
 import Unique  -- quite a few *Keys
-import Util    ( thenCmp, zipEqual, zipWithEqual, assoc )
-import Outputable
+import Util    ( thenCmp, panic )
 \end{code}
 
 
index 4793b12..6d406a8 100644 (file)
@@ -10,8 +10,8 @@ module Argv ( argv ) where
 
 import FastString
 
-import GlaExts ( Addr )
-import ArrBase ( indexAddrOffAddr )
+import GlaExts         ( Addr )
+import ByteArray       ( indexAddrOffAddr )
 
 argv :: [FAST_STRING]
 argv = unpackArgv ``prog_argv'' (``prog_argc''::Int)
index 15df0ba..b904fff 100644 (file)
@@ -34,12 +34,16 @@ module Digraph(
 
 #define ARR_ELT                (COMMA)
 
-import Array
-import List
+import Util    ( sortLt )
+
+-- GHC extensions
 import ST
-import ArrBase
+import MutableArray
+
+-- std interfaces
 import Maybe
-import Util    ( sortLt )
+import Array
+import List
 \end{code}
 
 
index 1635997..8a2d89a 100644 (file)
@@ -48,22 +48,31 @@ module FastString
 #define COMPILING_FAST_STRING
 #include "HsVersions.h"
 
+#if __GLASGOW_HASKELL__ < 301
 import PackBase
+import STBase          ( StateAndPtr#(..) )
+import IOHandle                ( filePtr, readHandle, writeHandle )
+import IOBase          ( Handle__(..), IOError(..), IOErrorType(..),
+                         IOResult(..), IO(..),
+                         constructError
+                       )
+#else
+import PrelPack
+import PrelST          ( StateAndPtr#(..) )
+import PrelHandle      ( filePtr, readHandle, writeHandle )
+import PrelIOBase      ( Handle__(..), IOError(..), IOErrorType(..),
+                         IOResult(..), IO(..),
+                         constructError
+                       )
+#endif
+
 import PrimPacked
 import GlaExts
-import Addr    ( Addr(..) )
-import STBase  ( StateAndPtr#(..) )
-import ArrBase ( MutableArray(..) )
-import Foreign ( ForeignObj(..) )
-import IOExts  ( IOArray(..), newIOArray,
-                 IORef, newIORef, readIORef, writeIORef
-               )
+import Addr            ( Addr(..) )
+import MutableArray    ( MutableArray(..) )
+import Foreign         ( ForeignObj(..) )
+import IOExts          ( IORef, newIORef, readIORef, writeIORef )
 import IO
-import IOHandle        ( filePtr, readHandle, writeHandle )
-import IOBase  ( Handle__(..), IOError(..), IOErrorType(..),
-                 IOResult(..), IO(..),
-                 constructError
-               )
 
 #define hASH_TBL_SIZE 993
 \end{code} 
@@ -458,19 +467,19 @@ hPutFS handle (FastString _ l# ba#) =
  if l# ==# 0# then
     return ()
  else
-    _readHandle handle                             >>= \ htype ->
+    readHandle handle                              >>= \ htype ->
     case htype of 
       ErrorHandle ioError ->
-         _writeHandle handle htype                 >>
+         writeHandle handle htype                  >>
           fail ioError
       ClosedHandle ->
-         _writeHandle handle htype                 >>
+         writeHandle handle htype                  >>
          fail MkIOError(handle,IllegalOperation,"handle is closed")
       SemiClosedHandle _ _ ->
-         _writeHandle handle htype                 >>
+         writeHandle handle htype                  >>
          fail MkIOError(handle,IllegalOperation,"handle is closed")
       ReadHandle _ _ _ ->
-         _writeHandle handle htype                 >>
+         writeHandle handle htype                  >>
          fail MkIOError(handle,IllegalOperation,"handle is not open for writing")
       other -> 
           let fp = filePtr htype in
@@ -485,19 +494,19 @@ hPutFS handle (CharStr a# l#) =
  if l# ==# 0# then
     return ()
  else
-    _readHandle handle                             >>= \ htype ->
+    readHandle handle                              >>= \ htype ->
     case htype of 
       ErrorHandle ioError ->
-         _writeHandle handle htype                 >>
+         writeHandle handle htype                  >>
           fail ioError
       ClosedHandle ->
-         _writeHandle handle htype                 >>
+         writeHandle handle htype                  >>
          fail MkIOError(handle,IllegalOperation,"handle is closed")
       SemiClosedHandle _ _ ->
-         _writeHandle handle htype                 >>
+         writeHandle handle htype                  >>
          fail MkIOError(handle,IllegalOperation,"handle is closed")
       ReadHandle _ _ _ ->
-         _writeHandle handle htype                 >>
+         writeHandle handle htype                  >>
          fail MkIOError(handle,IllegalOperation,"handle is not open for writing")
       other -> 
           let fp = filePtr htype in
index dfa2cd0..92cbfc5 100644 (file)
@@ -13,36 +13,13 @@ module ListSetOps (
 
 #include "HsVersions.h"
 
-import Util    ( isIn, isn'tIn )
+import Util    ( isn'tIn )
 import List    ( union )
 \end{code}
 
 \begin{code}
 unionLists :: (Eq a) => [a] -> [a] -> [a]
-#ifdef REALLY_HASKELL_1_3
 unionLists = union
-#else
-unionLists []     []           = []
-unionLists []     b            = b
-unionLists a      []           = a
-unionLists (a:as) b
-  | a `is_elem` b = unionLists as b
-  | otherwise     = a : unionLists as b
-  where
-    is_elem = isIn "unionLists"
-#endif
-
-{- UNUSED
-intersectLists :: (Eq a) => [a] -> [a] -> [a]
-intersectLists []     []               = []
-intersectLists []     b                        = []
-intersectLists a      []               = []
-intersectLists (a:as) b
-  | a `is_elem` b = a : intersectLists as b
-  | otherwise    = intersectLists as b
-  where
-    is_elem = isIn "intersectLists"
--}
 \end{code}
 
 Everything in the first list that is not in the second list:
index 223ff88..ab683cd 100644 (file)
@@ -12,8 +12,6 @@ module OrdList (
 
        flattenOrdList
     ) where
-
-import Util    ( mapAccumB, mapAccumL, mapAccumR )
 \end{code}
 
 This section provides an ordering list that allows fine grain
index 861f4b5..e09d59d 100644 (file)
@@ -42,7 +42,7 @@ module Outputable (
 #include "HsVersions.h"
 
 import IO              ( Handle, hPutChar, hPutStr, stderr, stdout )
-import CmdLineOpts     ( opt_PprStyle_All, opt_PprStyle_Debug, opt_PprStyle_User, opt_PprUserLength )
+import CmdLineOpts     ( opt_PprStyle_All, opt_PprStyle_Debug, opt_PprUserLength )
 import FastString
 import qualified Pretty
 import Pretty          ( Doc, Mode(..), TextDetails(..), fullRender )
index 455bf9f..cf36882 100644 (file)
@@ -32,12 +32,19 @@ module PrimPacked
 
 import GlaExts
 import Addr    ( Addr(..) )
-import GHC
-import ArrBase
 import ST
+import Foreign
+
+#if __GLASGOW_HASKELL__ < 301
+import ArrBase         ( StateAndMutableByteArray#(..), 
+                         StateAndByteArray#(..) )
 import STBase
-import IOBase  ( ForeignObj(..) )
-import PackBase ( unpackCStringBA, packString )
+#else
+import PrelArr         ( StateAndMutableByteArray#(..), 
+                         StateAndByteArray#(..) )
+import PrelST
+#endif
+
 \end{code} 
 
 Return the length of a @\\NUL@ terminated character string:
@@ -198,9 +205,6 @@ eqCharStrPrefix a1# a2# len# =
   unsafePerformIO (
    _ccall_ strncmp (A# a1#) (A# a2#) (I# len#) >>= \ (I# x#) ->
    return (x# ==# 0#))
-  where
-   bottom :: (Int,Int)
-   bottom = error "eqStrPrefix"
 
 eqStrPrefixBA :: ByteArray# -> ByteArray# -> Int# -> Int# -> Bool
 eqStrPrefixBA b1# b2# start# len# = 
@@ -241,14 +245,3 @@ eqStrPrefixFO fo# barr# start# len# =
    bottom :: (Int,Int)
    bottom = error "eqStrPrefixFO"
 \end{code}
-
-\begin{code}
-byteArrayToString :: ByteArray Int -> String
-byteArrayToString = unpackCStringBA
-\end{code}
-
-
-\begin{code}
-stringToByteArray :: String -> (ByteArray Int)
-stringToByteArray = packString
-\end{code}
index ac147dc..45a8174 100644 (file)
@@ -18,10 +18,18 @@ module SST(
 #include "HsVersions.h"
 
 import GlaExts
-import STBase
-import IOBase  ( IO(..), IOResult(..) )
-import ArrBase
 import ST
+
+#if __GLASGOW_HASKELL__ < 301
+import STBase          ( ST(..), STret(..), StateAndPtr#(..) )
+import ArrBase         ( StateAndMutableArray#(..) )
+import IOBase          ( IO(..), IOResult(..) )
+#else
+import PrelST          ( ST(..), STret(..), StateAndPtr#(..) )
+import PrelArr         ( StateAndMutableArray#(..) )
+import PrelIOBase      ( IO(..), IOResult(..) )
+#endif
+
 \end{code}
 
 @SST@ is very like the standard @ST@ monad, but it comes with its
index 6fac235..0fe695b 100644 (file)
@@ -69,15 +69,22 @@ module StringBuffer
 import GlaExts
 import Addr            ( Addr(..) )
 import Foreign
-import IOBase
-import IOHandle
 import ST
-import STBase
-import Char            (isDigit)
-import PackBase 
+import IO              ( openFile, hFileSize, hClose, IOMode(..) )
+
+#if __GLASGOW_HASKELL__ < 301
+import IOBase          ( IOError(..), IOErrorType(..) )
+import IOHandle                ( readHandle, writeHandle, filePtr )
+import PackBase        ( unpackCStringBA )
+#else
+import PrelIOBase      ( IOError(..), IOErrorType(..) )
+import PrelHandle      ( readHandle, writeHandle, filePtr )
+import PrelPack                ( unpackCStringBA )
+#endif
+
 import PrimPacked
 import FastString
-
+import Char            (isDigit)
 \end{code} 
 
 \begin{code}
@@ -114,7 +121,7 @@ hGetStringBuffer fname =
 --    makeForeignObj arr free_p                                     >>= \ fo@(_ForeignObj fo#) ->
      readHandle hndl        >>= \ hndl_ ->
      writeHandle hndl hndl_ >>
-     let ptr = _filePtr hndl_ in
+     let ptr = filePtr hndl_ in
      _ccall_ fread arr (1::Int) len_i ptr                     >>= \  (I# read#) ->
 --     trace ("DEBUG: opened " ++ fname ++ show (I# read#)) $
      hClose hndl                    >>
index 2fec976..0883011 100644 (file)
@@ -49,8 +49,6 @@ import {-# SOURCE #-} Name    ( Name )
 
 import Unique          ( Uniquable(..), Unique, u2i, mkUniqueGrimily )
 import Util
-import Outputable      ( Outputable(..) )
-import SrcLoc          ( SrcLoc )
 import GlaExts         -- Lots of Int# operations
 
 #if ! OMIT_NATIVE_CODEGEN
index 13b3eae..5089694 100644 (file)
@@ -25,8 +25,6 @@ import {-# SOURCE #-} Name
 import Maybes          ( maybeToBool )
 import UniqFM
 import Unique          ( Unique, Uniquable(..) )
-import SrcLoc          ( SrcLoc )
-import Outputable      ( Outputable(..) )
 
 #if ! OMIT_NATIVE_CODEGEN
 #define IF_NCG(a) a