1 Things which are ubiquitous in the GHC compiler.
6 import PreludePS(_PackedString)
9 import BinderInfo ( BinderInfo )
10 import CgBindery ( CgIdInfo )
11 import CharSeq ( CSeq )
12 import CLabel ( CLabel )
13 import Class ( GenClass, GenClassOp, Class(..), ClassOp )
14 import ClosureInfo ( ClosureInfo, LambdaFormInfo )
15 import CmdLineOpts ( SimplifierSwitch, SwitchResult )
16 import CoreSyn ( GenCoreArg, GenCoreBinder, GenCoreBinding, GenCoreExpr,
17 GenCoreCaseAlts, GenCoreCaseDefault, Coercion
19 import CoreUnfold ( UnfoldingDetails, UnfoldingGuidance )
20 import CostCentre ( CostCentre )
21 import FieldLabel ( FieldLabel )
22 import FiniteMap ( FiniteMap )
23 import HeapOffs ( HeapOffset )
24 import HsCore ( UnfoldingCoreExpr )
25 import HsPat ( OutPat )
26 import HsPragmas ( ClassOpPragmas, ClassPragmas, DataPragmas, GenPragmas, InstancePragmas )
27 import Id ( StrictnessMark, GenId, Id(..) )
28 import IdInfo ( IdInfo, OptIdInfo(..), ArityInfo, DeforestInfo, Demand, StrictnessInfo, UpdateInfo )
30 import Literal ( Literal )
31 import MachRegs ( Reg )
32 import Maybes ( MaybeErr )
33 import MatchEnv ( MatchEnv )
34 import Name ( Module(..), OrigName, RdrName, Name, ExportFlag, NamedThing(..) )
35 import Outputable ( Outputable(..) )
36 import PprStyle ( PprStyle )
37 import PragmaInfo ( PragmaInfo )
38 import Pretty ( PrettyRep )
39 import PrimOp ( PrimOp )
40 import PrimRep ( PrimRep )
41 import RnHsSyn ( RnName )
42 import SMRep ( SMRep )
43 import SrcLoc ( SrcLoc )
44 import TcType ( TcMaybe )
45 import TyCon ( TyCon, Arity(..) )
46 import TyVar ( GenTyVar, TyVar(..) )
47 import Type ( GenType, Type(..) )
48 import UniqFM ( UniqFM, Uniquable(..) )
49 import UniqSupply ( UniqSupply )
50 import Unique ( Unique )
51 import Usage ( GenUsage, Usage(..) )
52 import Util ( Ord3(..) )
54 -- All the classes in GHC go; life is just too short
55 -- to try to contain their visibility.
57 class NamedThing a where
59 class OptIdInfo a where
61 getInfo :: IdInfo -> a
62 addInfo :: IdInfo -> a -> IdInfo
63 ppInfo :: PprStyle -> (Id -> Id) -> a -> Int -> Bool -> PrettyRep
66 class Outputable a where
67 ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
68 class Uniquable a where
69 uniqueOf :: a -> Unique
71 -- For datatypes, we ubiquitize those types that (a) are
72 -- used everywhere and (b) the compiler doesn't lose much
73 -- optimisation-wise by not seeing their pragma-gunk.
95 data GenCoreBinder a b c
96 data GenCoreBinding a b c d
97 data GenCoreCaseAlts a b c d
98 data GenCoreCaseDefault a b c d
99 data GenCoreExpr a b c d
100 data GenId a -- NB: fails the optimisation criterion
102 data GenTyVar a -- NB: fails the optimisation criterion
107 data InstancePragmas a
114 data OrigName = OrigName _PackedString _PackedString
115 data RdrName = Unqual _PackedString | Qual _PackedString _PackedString
122 data PrimRep -- NB: an enumeration
124 data SimplifierSwitch
132 data UnfoldingCoreExpr a
136 data UnfoldingDetails
137 data UnfoldingGuidance
138 data Unique -- NB: fails the optimisation criterion
140 -- don't get clever and unexpand some of these synonyms
141 -- (GHC 0.26 will barf)
142 type Module = _PackedString
144 type Class = GenClass (GenTyVar (GenUsage Unique)) Unique
145 type ClassOp = GenClassOp (GenType (GenTyVar (GenUsage Unique)) Unique)
146 type Id = GenId (GenType (GenTyVar (GenUsage Unique)) Unique)
147 type Type = GenType (GenTyVar (GenUsage Unique)) Unique
148 type TyVar = GenTyVar (GenUsage Unique)
149 type Usage = GenUsage Unique
151 -- These are here only for SPECIALIZing in FiniteMap (ToDo:move?)
153 instance Ord OrigName
162 -- specializing in UniqFM, UniqSet
163 instance Uniquable Unique
164 instance Uniquable RnName
165 instance Uniquable Name
166 -- specializing in Name
167 instance NamedThing RnName