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
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,
29 import Id ( StrictnessMark, GenId, Id(..) )
30 import IdInfo ( IdInfo, OptIdInfo(..), ArityInfo, DeforestInfo, Demand, StrictnessInfo, UpdateInfo )
32 import Literal ( Literal )
33 import Maybes ( MaybeErr )
34 import MatchEnv ( MatchEnv )
36 import NameTypes ( FullName, ShortName )
37 import Outputable ( ExportFlag, NamedThing(..), Outputable(..) )
38 import PprStyle ( PprStyle )
39 import PragmaInfo ( PragmaInfo )
40 import Pretty ( PrettyRep )
41 import PrimOp ( PrimOp )
42 import PrimRep ( PrimRep )
43 import ProtoName ( ProtoName )
44 import SMRep ( SMRep )
45 import SrcLoc ( SrcLoc )
46 import TcType ( TcMaybe )
47 import TyCon ( TyCon, Arity(..) )
48 import TyVar ( GenTyVar, TyVar(..) )
49 import Type ( GenType, Type(..) )
50 import UniqFM ( UniqFM )
51 import UniqSupply ( UniqSupply )
52 import Unique ( Unique )
53 import Usage ( GenUsage, Usage(..) )
54 import Util ( Ord3(..) )
56 -- All the classes in GHC go; life is just too short
57 -- to try to contain their visibility.
59 class NamedThing a where
60 getExportFlag :: a -> ExportFlag
61 isLocallyDefined :: a -> Bool
62 getOrigName :: a -> (_PackedString, _PackedString)
63 getOccurrenceName :: a -> _PackedString
64 getInformingModules :: a -> [_PackedString]
65 getSrcLoc :: a -> SrcLoc
66 getItsUnique :: a -> Unique
67 fromPreludeCore :: a -> Bool
68 class OptIdInfo a where
70 getInfo :: IdInfo -> a
71 addInfo :: IdInfo -> a -> IdInfo
72 ppInfo :: PprStyle -> (Id -> Id) -> a -> Int -> Bool -> PrettyRep
75 class Outputable a where
76 ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
78 -- For datatypes, we ubiquitize those types that (a) are
79 -- used everywhere and (b) the compiler doesn't lose much
80 -- optimisation-wise by not seeing their pragma-gunk.
98 data FullName -- NB: fails the optimisation criterion
101 data GenCoreArg a b c
102 data GenCoreBinder a b c
103 data GenCoreBinding a b c d
104 data GenCoreCaseAlts a b c d
105 data GenCoreCaseDefault a b c d
106 data GenCoreExpr a b c d
107 data GenId a -- NB: fails the optimisation criterion
109 data GenTyVar a -- NB: fails the optimisation criterion
114 data InstancePragmas a
126 data PrimRep -- NB: an enumeration
128 data ShortName -- NB: fails the optimisation criterion
129 data SimplifierSwitch
137 data UnfoldingCoreExpr a
141 data UnfoldingDetails
142 data UnfoldingGuidance
143 data Unique -- NB: fails the optimisation criterion
145 -- don't get clever and unexpand some of these synonyms
146 -- (GHC 0.26 will barf)
148 type Class = GenClass (GenTyVar (GenUsage Unique)) Unique
149 type ClassOp = GenClassOp (GenType (GenTyVar (GenUsage Unique)) Unique)
150 type Id = GenId (GenType (GenTyVar (GenUsage Unique)) Unique)
151 type Type = GenType (GenTyVar (GenUsage Unique)) Unique
152 type TyVar = GenTyVar (GenUsage Unique)
153 type Usage = GenUsage Unique