Things which are ubiquitous in the GHC compiler. \begin{code} interface Ubiq where --import PreludePS(_PackedString) import FastString(FastString) import Bag ( Bag ) import BinderInfo ( BinderInfo ) import CgBindery ( CgIdInfo ) import CharSeq ( CSeq ) import CLabel ( CLabel ) import Class ( GenClass, GenClassOp, Class(..), ClassOp ) import ClosureInfo ( ClosureInfo, LambdaFormInfo ) import CmdLineOpts ( SimplifierSwitch, SwitchResult ) import CoreSyn ( GenCoreArg, GenCoreBinder, GenCoreBinding, GenCoreExpr, GenCoreCaseAlts, GenCoreCaseDefault, Coercion ) import CoreUnfold ( Unfolding, UnfoldingGuidance ) import CostCentre ( CostCentre ) import FieldLabel ( FieldLabel ) import FiniteMap ( FiniteMap ) import HeapOffs ( HeapOffset ) import HsPat ( OutPat ) import HsPragmas ( ClassOpPragmas, ClassPragmas, DataPragmas, GenPragmas, InstancePragmas ) import Id ( StrictnessMark, GenId, Id(..) ) import IdInfo ( IdInfo, ArityInfo, DeforestInfo, StrictnessInfo, UpdateInfo ) import Demand ( Demand ) import Kind ( Kind ) import Literal ( Literal ) import MachRegs ( Reg ) import Maybes ( MaybeErr ) import MatchEnv ( MatchEnv ) import Name ( Module(..), OccName, Name, ExportFlag, NamedThing(..) ) import Outputable ( Outputable(..) ) import PprStyle ( PprStyle ) import PragmaInfo ( PragmaInfo ) import Pretty ( PrettyRep ) import PrimOp ( PrimOp ) import PrimRep ( PrimRep ) import SMRep ( SMRep ) import SrcLoc ( SrcLoc ) import TcType ( TcMaybe ) import TyCon ( TyCon, Arity(..) ) import TyVar ( GenTyVar, TyVar(..) ) import Type ( GenType, Type(..) ) import UniqFM ( UniqFM, Uniquable(..) ) import UniqSupply ( UniqSupply ) import Unique ( Unique ) import Usage ( GenUsage, Usage(..) ) import Util ( Ord3(..) ) -- All the classes in GHC go; life is just too short -- to try to contain their visibility. class NamedThing a where getOccName :: a -> OccName getName :: a -> Name class Ord3 a where cmp :: a -> a -> Int# class Outputable a where ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep class Uniquable a where uniqueOf :: a -> Unique -- For datatypes, we ubiquitize those types that (a) are -- used everywhere and (b) the compiler doesn't lose much -- optimisation-wise by not seeing their pragma-gunk. data ArityInfo data Bag a data BinderInfo data CgIdInfo data CLabel data ClassOpPragmas a data ClassPragmas a data ClosureInfo data Coercion data CostCentre data CSeq data DataPragmas a data DeforestInfo data Demand data ExportFlag data FieldLabel data FiniteMap a b data GenClass a b data GenClassOp a data GenCoreArg a b c data GenCoreBinder a b c data GenCoreBinding a b c d data GenCoreCaseAlts a b c d data GenCoreCaseDefault a b c d data GenCoreExpr a b c d data GenId a -- NB: fails the optimisation criterion data GenPragmas a data GenTyVar a -- NB: fails the optimisation criterion data GenType a b data GenUsage a data HeapOffset data IdInfo data InstancePragmas a data Kind data LambdaFormInfo data Literal data MaybeErr a b data MatchEnv a b data Name data OccName data Reg data OutPat a b c data PprStyle data PragmaInfo data PrettyRep data PrimOp data PrimRep -- NB: an enumeration data SimplifierSwitch data SMRep data SrcLoc data StrictnessInfo bdee data StrictnessMark data SwitchResult data TcMaybe s data TyCon data UniqFM a data UpdateInfo data UniqSupply data Unfolding data UnfoldingGuidance data Unique -- NB: fails the optimisation criterion -- don't get clever and unexpand some of these synonyms -- (GHC 0.26 will barf) type Module = FastString type Arity = Int type Class = GenClass (GenTyVar (GenUsage Unique)) Unique type ClassOp = GenClassOp (GenType (GenTyVar (GenUsage Unique)) Unique) type Id = GenId (GenType (GenTyVar (GenUsage Unique)) Unique) type Type = GenType (GenTyVar (GenUsage Unique)) Unique type TyVar = GenTyVar (GenUsage Unique) type Usage = GenUsage Unique -- These are here only for SPECIALIZing in FiniteMap (ToDo:move?) instance Ord Reg instance Ord CLabel instance Ord TyCon instance Eq Reg instance Eq CLabel instance Eq TyCon -- specializing in UniqFM, UniqSet instance Uniquable Unique instance Uniquable Name -- specializing in Name \end{code}