never executed always true always false
1 {-
2 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
3
4 \section[GHC.Builtin.Names]{Definitions of prelude modules and names}
5
6
7 Nota Bene: all Names defined in here should come from the base package
8
9 - ModuleNames for prelude modules,
10 e.g. pREL_BASE_Name :: ModuleName
11
12 - Modules for prelude modules
13 e.g. pREL_Base :: Module
14
15 - Uniques for Ids, DataCons, TyCons and Classes that the compiler
16 "knows about" in some way
17 e.g. intTyConKey :: Unique
18 minusClassOpKey :: Unique
19
20 - Names for Ids, DataCons, TyCons and Classes that the compiler
21 "knows about" in some way
22 e.g. intTyConName :: Name
23 minusName :: Name
24 One of these Names contains
25 (a) the module and occurrence name of the thing
26 (b) its Unique
27 The way the compiler "knows about" one of these things is
28 where the type checker or desugarer needs to look it up. For
29 example, when desugaring list comprehensions the desugarer
30 needs to conjure up 'foldr'. It does this by looking up
31 foldrName in the environment.
32
33 - RdrNames for Ids, DataCons etc that the compiler may emit into
34 generated code (e.g. for deriving). It's not necessary to know
35 the uniques for these guys, only their names
36
37
38 Note [Known-key names]
39 ~~~~~~~~~~~~~~~~~~~~~~
40 It is *very* important that the compiler gives wired-in things and
41 things with "known-key" names the correct Uniques wherever they
42 occur. We have to be careful about this in exactly two places:
43
44 1. When we parse some source code, renaming the AST better yield an
45 AST whose Names have the correct uniques
46
47 2. When we read an interface file, the read-in gubbins better have
48 the right uniques
49
50 This is accomplished through a combination of mechanisms:
51
52 1. When parsing source code, the RdrName-decorated AST has some
53 RdrNames which are Exact. These are wired-in RdrNames where the
54 we could directly tell from the parsed syntax what Name to
55 use. For example, when we parse a [] in a type we can just insert
56 an Exact RdrName Name with the listTyConKey.
57
58 Currently, I believe this is just an optimisation: it would be
59 equally valid to just output Orig RdrNames that correctly record
60 the module etc we expect the final Name to come from. However,
61 were we to eliminate isBuiltInOcc_maybe it would become essential
62 (see point 3).
63
64 2. The knownKeyNames (which consist of the basicKnownKeyNames from
65 the module, and those names reachable via the wired-in stuff from
66 GHC.Builtin.Types) are used to initialise the "OrigNameCache" in
67 GHC.Iface.Env. This initialization ensures that when the type checker
68 or renamer (both of which use GHC.Iface.Env) look up an original name
69 (i.e. a pair of a Module and an OccName) for a known-key name
70 they get the correct Unique.
71
72 This is the most important mechanism for ensuring that known-key
73 stuff gets the right Unique, and is why it is so important to
74 place your known-key names in the appropriate lists.
75
76 3. For "infinite families" of known-key names (i.e. tuples and sums), we
77 have to be extra careful. Because there are an infinite number of
78 these things, we cannot add them to the list of known-key names
79 used to initialise the OrigNameCache. Instead, we have to
80 rely on never having to look them up in that cache. See
81 Note [Infinite families of known-key names] for details.
82
83
84 Note [Infinite families of known-key names]
85 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86 Infinite families of known-key things (e.g. tuples and sums) pose a tricky
87 problem: we can't add them to the knownKeyNames finite map which we use to
88 ensure that, e.g., a reference to (,) gets assigned the right unique (if this
89 doesn't sound familiar see Note [Known-key names] above).
90
91 We instead handle tuples and sums separately from the "vanilla" known-key
92 things,
93
94 a) The parser recognises them specially and generates an Exact Name (hence not
95 looked up in the orig-name cache)
96
97 b) The known infinite families of names are specially serialised by
98 GHC.Iface.Binary.putName, with that special treatment detected when we read
99 back to ensure that we get back to the correct uniques. See Note [Symbol
100 table representation of names] in GHC.Iface.Binary and Note [How tuples
101 work] in GHC.Builtin.Types.
102
103 Most of the infinite families cannot occur in source code, so mechanisms (a) and (b)
104 suffice to ensure that they always have the right Unique. In particular,
105 implicit param TyCon names, constraint tuples and Any TyCons cannot be mentioned
106 by the user. For those things that *can* appear in source programs,
107
108 c) GHC.Iface.Env.lookupOrigNameCache uses isBuiltInOcc_maybe to map built-in syntax
109 directly onto the corresponding name, rather than trying to find it in the
110 original-name cache.
111
112 See also Note [Built-in syntax and the OrigNameCache]
113
114 Note that one-tuples are an exception to the rule, as they do get assigned
115 known keys. See
116 Note [One-tuples] (Wrinkle: Make boxed one-tuple names have known keys)
117 in GHC.Builtin.Types.
118
119 -}
120
121 {-# LANGUAGE CPP #-}
122 {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
123
124 module GHC.Builtin.Names
125 ( Unique, Uniquable(..), hasKey, -- Re-exported for convenience
126
127 -----------------------------------------------------------
128 module GHC.Builtin.Names, -- A huge bunch of (a) Names, e.g. intTyConName
129 -- (b) Uniques e.g. intTyConKey
130 -- (c) Groups of classes and types
131 -- (d) miscellaneous things
132 -- So many that we export them all
133 )
134 where
135
136 import GHC.Prelude
137
138 import GHC.Unit.Types
139 import GHC.Unit.Module.Name
140 import GHC.Types.Name.Occurrence
141 import GHC.Types.Name.Reader
142 import GHC.Types.Unique
143 import GHC.Builtin.Uniques
144 import GHC.Types.Name
145 import GHC.Types.SrcLoc
146 import GHC.Data.FastString
147
148 {-
149 ************************************************************************
150 * *
151 allNameStrings
152 * *
153 ************************************************************************
154 -}
155
156 allNameStrings :: [String]
157 -- Infinite list of a,b,c...z, aa, ab, ac, ... etc
158 allNameStrings = [ c:cs | cs <- "" : allNameStrings, c <- ['a'..'z'] ]
159
160 {-
161 ************************************************************************
162 * *
163 \subsection{Local Names}
164 * *
165 ************************************************************************
166
167 This *local* name is used by the interactive stuff
168 -}
169
170 itName :: Unique -> SrcSpan -> Name
171 itName uniq loc = mkInternalName uniq (mkOccNameFS varName (fsLit "it")) loc
172
173 -- mkUnboundName makes a place-holder Name; it shouldn't be looked at except possibly
174 -- during compiler debugging.
175 mkUnboundName :: OccName -> Name
176 mkUnboundName occ = mkInternalName unboundKey occ noSrcSpan
177
178 isUnboundName :: Name -> Bool
179 isUnboundName name = name `hasKey` unboundKey
180
181 {-
182 ************************************************************************
183 * *
184 \subsection{Known key Names}
185 * *
186 ************************************************************************
187
188 This section tells what the compiler knows about the association of
189 names with uniques. These ones are the *non* wired-in ones. The
190 wired in ones are defined in GHC.Builtin.Types etc.
191 -}
192
193 basicKnownKeyNames :: [Name] -- See Note [Known-key names]
194 basicKnownKeyNames
195 = genericTyConNames
196 ++ [ -- Classes. *Must* include:
197 -- classes that are grabbed by key (e.g., eqClassKey)
198 -- classes in "Class.standardClassKeys" (quite a few)
199 eqClassName, -- mentioned, derivable
200 ordClassName, -- derivable
201 boundedClassName, -- derivable
202 numClassName, -- mentioned, numeric
203 enumClassName, -- derivable
204 monadClassName,
205 functorClassName,
206 realClassName, -- numeric
207 integralClassName, -- numeric
208 fractionalClassName, -- numeric
209 floatingClassName, -- numeric
210 realFracClassName, -- numeric
211 realFloatClassName, -- numeric
212 dataClassName,
213 isStringClassName,
214 applicativeClassName,
215 alternativeClassName,
216 foldableClassName,
217 traversableClassName,
218 semigroupClassName, sappendName,
219 monoidClassName, memptyName, mappendName, mconcatName,
220
221 -- The IO type
222 -- See Note [TyConRepNames for non-wired-in TyCons]
223 ioTyConName, ioDataConName,
224 runMainIOName,
225 runRWName,
226 withDictName,
227
228 -- Type representation types
229 trModuleTyConName, trModuleDataConName,
230 trNameTyConName, trNameSDataConName, trNameDDataConName,
231 trTyConTyConName, trTyConDataConName,
232
233 -- Typeable
234 typeableClassName,
235 typeRepTyConName,
236 someTypeRepTyConName,
237 someTypeRepDataConName,
238 kindRepTyConName,
239 kindRepTyConAppDataConName,
240 kindRepVarDataConName,
241 kindRepAppDataConName,
242 kindRepFunDataConName,
243 kindRepTYPEDataConName,
244 kindRepTypeLitSDataConName,
245 kindRepTypeLitDDataConName,
246 typeLitSortTyConName,
247 typeLitSymbolDataConName,
248 typeLitNatDataConName,
249 typeLitCharDataConName,
250 typeRepIdName,
251 mkTrTypeName,
252 mkTrConName,
253 mkTrAppName,
254 mkTrFunName,
255 typeSymbolTypeRepName, typeNatTypeRepName, typeCharTypeRepName,
256 trGhcPrimModuleName,
257
258 -- KindReps for common cases
259 starKindRepName,
260 starArrStarKindRepName,
261 starArrStarArrStarKindRepName,
262
263 -- Dynamic
264 toDynName,
265
266 -- Numeric stuff
267 negateName, minusName, geName, eqName,
268 mkRationalBase2Name, mkRationalBase10Name,
269
270 -- Conversion functions
271 rationalTyConName,
272 ratioTyConName, ratioDataConName,
273 fromRationalName, fromIntegerName,
274 toIntegerName, toRationalName,
275 fromIntegralName, realToFracName,
276
277 -- Int# stuff
278 divIntName, modIntName,
279
280 -- String stuff
281 fromStringName,
282
283 -- Enum stuff
284 enumFromName, enumFromThenName,
285 enumFromThenToName, enumFromToName,
286
287 -- Applicative stuff
288 pureAName, apAName, thenAName,
289
290 -- Functor stuff
291 fmapName,
292
293 -- Monad stuff
294 thenIOName, bindIOName, returnIOName, failIOName, bindMName, thenMName,
295 returnMName, joinMName,
296
297 -- MonadFail
298 monadFailClassName, failMName,
299
300 -- MonadFix
301 monadFixClassName, mfixName,
302
303 -- Arrow stuff
304 arrAName, composeAName, firstAName,
305 appAName, choiceAName, loopAName,
306
307 -- Ix stuff
308 ixClassName,
309
310 -- Show stuff
311 showClassName,
312
313 -- Read stuff
314 readClassName,
315
316 -- Stable pointers
317 newStablePtrName,
318
319 -- GHC Extensions
320 groupWithName,
321 considerAccessibleName,
322
323 -- Strings and lists
324 unpackCStringName, unpackCStringUtf8Name,
325 unpackCStringAppendName, unpackCStringAppendUtf8Name,
326 unpackCStringFoldrName, unpackCStringFoldrUtf8Name,
327 cstringLengthName,
328
329 -- Overloaded lists
330 isListClassName,
331 fromListName,
332 fromListNName,
333 toListName,
334
335 -- Overloaded record dot, record update
336 getFieldName, setFieldName,
337
338 -- List operations
339 concatName, filterName, mapName,
340 zipName, foldrName, buildName, augmentName, appendName,
341
342 -- FFI primitive types that are not wired-in.
343 stablePtrTyConName, ptrTyConName, funPtrTyConName,
344 int8TyConName, int16TyConName, int32TyConName, int64TyConName,
345 word8TyConName, word16TyConName, word32TyConName, word64TyConName,
346
347 -- Others
348 otherwiseIdName, inlineIdName,
349 eqStringName, assertName,
350 assertErrorName, traceName,
351 printName,
352 dollarName,
353
354 -- ghc-bignum
355 integerFromNaturalName,
356 integerToNaturalClampName,
357 integerToNaturalThrowName,
358 integerToNaturalName,
359 integerToWordName,
360 integerToIntName,
361 integerToWord64Name,
362 integerToInt64Name,
363 integerFromWordName,
364 integerFromWord64Name,
365 integerFromInt64Name,
366 integerAddName,
367 integerMulName,
368 integerSubName,
369 integerNegateName,
370 integerAbsName,
371 integerPopCountName,
372 integerQuotName,
373 integerRemName,
374 integerDivName,
375 integerModName,
376 integerDivModName,
377 integerQuotRemName,
378 integerEncodeFloatName,
379 integerEncodeDoubleName,
380 integerGcdName,
381 integerLcmName,
382 integerAndName,
383 integerOrName,
384 integerXorName,
385 integerComplementName,
386 integerBitName,
387 integerTestBitName,
388 integerShiftLName,
389 integerShiftRName,
390
391 naturalToWordName,
392 naturalPopCountName,
393 naturalShiftRName,
394 naturalShiftLName,
395 naturalAddName,
396 naturalSubName,
397 naturalSubThrowName,
398 naturalSubUnsafeName,
399 naturalMulName,
400 naturalQuotRemName,
401 naturalQuotName,
402 naturalRemName,
403 naturalAndName,
404 naturalAndNotName,
405 naturalOrName,
406 naturalXorName,
407 naturalTestBitName,
408 naturalBitName,
409 naturalGcdName,
410 naturalLcmName,
411 naturalLog2Name,
412 naturalLogBaseWordName,
413 naturalLogBaseName,
414 naturalPowModName,
415 naturalSizeInBaseName,
416
417 bignatFromWordListName,
418 bignatEqName,
419
420 -- Float/Double
421 integerToFloatName,
422 integerToDoubleName,
423 naturalToFloatName,
424 naturalToDoubleName,
425 rationalToFloatName,
426 rationalToDoubleName,
427
428 -- Other classes
429 randomClassName, randomGenClassName, monadPlusClassName,
430
431 -- Type-level naturals
432 knownNatClassName, knownSymbolClassName, knownCharClassName,
433
434 -- Overloaded labels
435 fromLabelClassOpName,
436
437 -- Implicit Parameters
438 ipClassName,
439
440 -- Overloaded record fields
441 hasFieldClassName,
442
443 -- Call Stacks
444 callStackTyConName,
445 emptyCallStackName, pushCallStackName,
446
447 -- Source Locations
448 srcLocDataConName,
449
450 -- Annotation type checking
451 toAnnotationWrapperName
452
453 -- The SPEC type for SpecConstr
454 , specTyConName
455
456 -- The Either type
457 , eitherTyConName, leftDataConName, rightDataConName
458
459 -- Plugins
460 , pluginTyConName
461 , frontendPluginTyConName
462
463 -- Generics
464 , genClassName, gen1ClassName
465 , datatypeClassName, constructorClassName, selectorClassName
466
467 -- Monad comprehensions
468 , guardMName
469 , liftMName
470 , mzipName
471
472 -- GHCi Sandbox
473 , ghciIoClassName, ghciStepIoMName
474
475 -- StaticPtr
476 , makeStaticName
477 , staticPtrTyConName
478 , staticPtrDataConName, staticPtrInfoDataConName
479 , fromStaticPtrName
480
481 -- Fingerprint
482 , fingerprintDataConName
483
484 -- Custom type errors
485 , errorMessageTypeErrorFamName
486 , typeErrorTextDataConName
487 , typeErrorAppendDataConName
488 , typeErrorVAppendDataConName
489 , typeErrorShowTypeDataConName
490
491 -- Unsafe coercion proofs
492 , unsafeEqualityProofName
493 , unsafeEqualityTyConName
494 , unsafeReflDataConName
495 , unsafeCoercePrimName
496 ]
497
498 genericTyConNames :: [Name]
499 genericTyConNames = [
500 v1TyConName, u1TyConName, par1TyConName, rec1TyConName,
501 k1TyConName, m1TyConName, sumTyConName, prodTyConName,
502 compTyConName, rTyConName, dTyConName,
503 cTyConName, sTyConName, rec0TyConName,
504 d1TyConName, c1TyConName, s1TyConName,
505 repTyConName, rep1TyConName, uRecTyConName,
506 uAddrTyConName, uCharTyConName, uDoubleTyConName,
507 uFloatTyConName, uIntTyConName, uWordTyConName,
508 prefixIDataConName, infixIDataConName, leftAssociativeDataConName,
509 rightAssociativeDataConName, notAssociativeDataConName,
510 sourceUnpackDataConName, sourceNoUnpackDataConName,
511 noSourceUnpackednessDataConName, sourceLazyDataConName,
512 sourceStrictDataConName, noSourceStrictnessDataConName,
513 decidedLazyDataConName, decidedStrictDataConName, decidedUnpackDataConName,
514 metaDataDataConName, metaConsDataConName, metaSelDataConName
515 ]
516
517 {-
518 ************************************************************************
519 * *
520 \subsection{Module names}
521 * *
522 ************************************************************************
523
524
525 --MetaHaskell Extension Add a new module here
526 -}
527
528 pRELUDE :: Module
529 pRELUDE = mkBaseModule_ pRELUDE_NAME
530
531 gHC_PRIM, gHC_PRIM_PANIC, gHC_PRIM_EXCEPTION,
532 gHC_TYPES, gHC_GENERICS, gHC_MAGIC, gHC_MAGIC_DICT,
533 gHC_CLASSES, gHC_PRIMOPWRAPPERS, gHC_BASE, gHC_ENUM,
534 gHC_GHCI, gHC_GHCI_HELPERS, gHC_CSTRING,
535 gHC_SHOW, gHC_READ, gHC_NUM, gHC_MAYBE,
536 gHC_NUM_INTEGER, gHC_NUM_NATURAL, gHC_NUM_BIGNAT,
537 gHC_LIST, gHC_TUPLE, dATA_EITHER, dATA_LIST, dATA_STRING,
538 dATA_FOLDABLE, dATA_TRAVERSABLE,
539 gHC_CONC, gHC_IO, gHC_IO_Exception,
540 gHC_ST, gHC_IX, gHC_STABLE, gHC_PTR, gHC_ERR, gHC_REAL,
541 gHC_FLOAT, gHC_TOP_HANDLER, sYSTEM_IO, dYNAMIC,
542 tYPEABLE, tYPEABLE_INTERNAL, gENERICS,
543 rEAD_PREC, lEX, gHC_INT, gHC_WORD, mONAD, mONAD_FIX, mONAD_ZIP, mONAD_FAIL,
544 aRROW, gHC_DESUGAR, rANDOM, gHC_EXTS,
545 cONTROL_EXCEPTION_BASE, gHC_TYPEERROR, gHC_TYPELITS, gHC_TYPELITS_INTERNAL,
546 gHC_TYPENATS, gHC_TYPENATS_INTERNAL,
547 dATA_COERCE, dEBUG_TRACE, uNSAFE_COERCE :: Module
548
549 gHC_PRIM = mkPrimModule (fsLit "GHC.Prim") -- Primitive types and values
550 gHC_PRIM_PANIC = mkPrimModule (fsLit "GHC.Prim.Panic")
551 gHC_PRIM_EXCEPTION = mkPrimModule (fsLit "GHC.Prim.Exception")
552 gHC_TYPES = mkPrimModule (fsLit "GHC.Types")
553 gHC_MAGIC = mkPrimModule (fsLit "GHC.Magic")
554 gHC_MAGIC_DICT = mkPrimModule (fsLit "GHC.Magic.Dict")
555 gHC_CSTRING = mkPrimModule (fsLit "GHC.CString")
556 gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes")
557 gHC_PRIMOPWRAPPERS = mkPrimModule (fsLit "GHC.PrimopWrappers")
558
559 gHC_BASE = mkBaseModule (fsLit "GHC.Base")
560 gHC_ENUM = mkBaseModule (fsLit "GHC.Enum")
561 gHC_GHCI = mkBaseModule (fsLit "GHC.GHCi")
562 gHC_GHCI_HELPERS= mkBaseModule (fsLit "GHC.GHCi.Helpers")
563 gHC_SHOW = mkBaseModule (fsLit "GHC.Show")
564 gHC_READ = mkBaseModule (fsLit "GHC.Read")
565 gHC_NUM = mkBaseModule (fsLit "GHC.Num")
566 gHC_MAYBE = mkBaseModule (fsLit "GHC.Maybe")
567 gHC_NUM_INTEGER = mkBignumModule (fsLit "GHC.Num.Integer")
568 gHC_NUM_NATURAL = mkBignumModule (fsLit "GHC.Num.Natural")
569 gHC_NUM_BIGNAT = mkBignumModule (fsLit "GHC.Num.BigNat")
570 gHC_LIST = mkBaseModule (fsLit "GHC.List")
571 gHC_TUPLE = mkPrimModule (fsLit "GHC.Tuple")
572 dATA_EITHER = mkBaseModule (fsLit "Data.Either")
573 dATA_LIST = mkBaseModule (fsLit "Data.List")
574 dATA_STRING = mkBaseModule (fsLit "Data.String")
575 dATA_FOLDABLE = mkBaseModule (fsLit "Data.Foldable")
576 dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable")
577 gHC_CONC = mkBaseModule (fsLit "GHC.Conc")
578 gHC_IO = mkBaseModule (fsLit "GHC.IO")
579 gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
580 gHC_ST = mkBaseModule (fsLit "GHC.ST")
581 gHC_IX = mkBaseModule (fsLit "GHC.Ix")
582 gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
583 gHC_PTR = mkBaseModule (fsLit "GHC.Ptr")
584 gHC_ERR = mkBaseModule (fsLit "GHC.Err")
585 gHC_REAL = mkBaseModule (fsLit "GHC.Real")
586 gHC_FLOAT = mkBaseModule (fsLit "GHC.Float")
587 gHC_TOP_HANDLER = mkBaseModule (fsLit "GHC.TopHandler")
588 sYSTEM_IO = mkBaseModule (fsLit "System.IO")
589 dYNAMIC = mkBaseModule (fsLit "Data.Dynamic")
590 tYPEABLE = mkBaseModule (fsLit "Data.Typeable")
591 tYPEABLE_INTERNAL = mkBaseModule (fsLit "Data.Typeable.Internal")
592 gENERICS = mkBaseModule (fsLit "Data.Data")
593 rEAD_PREC = mkBaseModule (fsLit "Text.ParserCombinators.ReadPrec")
594 lEX = mkBaseModule (fsLit "Text.Read.Lex")
595 gHC_INT = mkBaseModule (fsLit "GHC.Int")
596 gHC_WORD = mkBaseModule (fsLit "GHC.Word")
597 mONAD = mkBaseModule (fsLit "Control.Monad")
598 mONAD_FIX = mkBaseModule (fsLit "Control.Monad.Fix")
599 mONAD_ZIP = mkBaseModule (fsLit "Control.Monad.Zip")
600 mONAD_FAIL = mkBaseModule (fsLit "Control.Monad.Fail")
601 aRROW = mkBaseModule (fsLit "Control.Arrow")
602 gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
603 rANDOM = mkBaseModule (fsLit "System.Random")
604 gHC_EXTS = mkBaseModule (fsLit "GHC.Exts")
605 cONTROL_EXCEPTION_BASE = mkBaseModule (fsLit "Control.Exception.Base")
606 gHC_GENERICS = mkBaseModule (fsLit "GHC.Generics")
607 gHC_TYPEERROR = mkBaseModule (fsLit "GHC.TypeError")
608 gHC_TYPELITS = mkBaseModule (fsLit "GHC.TypeLits")
609 gHC_TYPELITS_INTERNAL = mkBaseModule (fsLit "GHC.TypeLits.Internal")
610 gHC_TYPENATS = mkBaseModule (fsLit "GHC.TypeNats")
611 gHC_TYPENATS_INTERNAL = mkBaseModule (fsLit "GHC.TypeNats.Internal")
612 dATA_COERCE = mkBaseModule (fsLit "Data.Coerce")
613 dEBUG_TRACE = mkBaseModule (fsLit "Debug.Trace")
614 uNSAFE_COERCE = mkBaseModule (fsLit "Unsafe.Coerce")
615
616 gHC_SRCLOC :: Module
617 gHC_SRCLOC = mkBaseModule (fsLit "GHC.SrcLoc")
618
619 gHC_STACK, gHC_STACK_TYPES :: Module
620 gHC_STACK = mkBaseModule (fsLit "GHC.Stack")
621 gHC_STACK_TYPES = mkBaseModule (fsLit "GHC.Stack.Types")
622
623 gHC_STATICPTR :: Module
624 gHC_STATICPTR = mkBaseModule (fsLit "GHC.StaticPtr")
625
626 gHC_STATICPTR_INTERNAL :: Module
627 gHC_STATICPTR_INTERNAL = mkBaseModule (fsLit "GHC.StaticPtr.Internal")
628
629 gHC_FINGERPRINT_TYPE :: Module
630 gHC_FINGERPRINT_TYPE = mkBaseModule (fsLit "GHC.Fingerprint.Type")
631
632 gHC_OVER_LABELS :: Module
633 gHC_OVER_LABELS = mkBaseModule (fsLit "GHC.OverloadedLabels")
634
635 gHC_RECORDS :: Module
636 gHC_RECORDS = mkBaseModule (fsLit "GHC.Records")
637
638 rOOT_MAIN :: Module
639 rOOT_MAIN = mkMainModule (fsLit ":Main") -- Root module for initialisation
640
641 mkInteractiveModule :: Int -> Module
642 -- (mkInteractiveMoudule 9) makes module 'interactive:Ghci9'
643 mkInteractiveModule n = mkModule interactiveUnit (mkModuleName ("Ghci" ++ show n))
644
645 pRELUDE_NAME, mAIN_NAME :: ModuleName
646 pRELUDE_NAME = mkModuleNameFS (fsLit "Prelude")
647 mAIN_NAME = mkModuleNameFS (fsLit "Main")
648
649 mkPrimModule :: FastString -> Module
650 mkPrimModule m = mkModule primUnit (mkModuleNameFS m)
651
652 mkBignumModule :: FastString -> Module
653 mkBignumModule m = mkModule bignumUnit (mkModuleNameFS m)
654
655 mkBaseModule :: FastString -> Module
656 mkBaseModule m = mkBaseModule_ (mkModuleNameFS m)
657
658 mkBaseModule_ :: ModuleName -> Module
659 mkBaseModule_ m = mkModule baseUnit m
660
661 mkThisGhcModule :: FastString -> Module
662 mkThisGhcModule m = mkThisGhcModule_ (mkModuleNameFS m)
663
664 mkThisGhcModule_ :: ModuleName -> Module
665 mkThisGhcModule_ m = mkModule thisGhcUnit m
666
667 mkMainModule :: FastString -> Module
668 mkMainModule m = mkModule mainUnit (mkModuleNameFS m)
669
670 mkMainModule_ :: ModuleName -> Module
671 mkMainModule_ m = mkModule mainUnit m
672
673 {-
674 ************************************************************************
675 * *
676 RdrNames
677 * *
678 ************************************************************************
679 -}
680
681 main_RDR_Unqual :: RdrName
682 main_RDR_Unqual = mkUnqual varName (fsLit "main")
683 -- We definitely don't want an Orig RdrName, because
684 -- main might, in principle, be imported into module Main
685
686 eq_RDR, ge_RDR, le_RDR, lt_RDR, gt_RDR, compare_RDR,
687 ltTag_RDR, eqTag_RDR, gtTag_RDR :: RdrName
688 eq_RDR = nameRdrName eqName
689 ge_RDR = nameRdrName geName
690 le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=")
691 lt_RDR = varQual_RDR gHC_CLASSES (fsLit "<")
692 gt_RDR = varQual_RDR gHC_CLASSES (fsLit ">")
693 compare_RDR = varQual_RDR gHC_CLASSES (fsLit "compare")
694 ltTag_RDR = nameRdrName ordLTDataConName
695 eqTag_RDR = nameRdrName ordEQDataConName
696 gtTag_RDR = nameRdrName ordGTDataConName
697
698 eqClass_RDR, numClass_RDR, ordClass_RDR, enumClass_RDR, monadClass_RDR
699 :: RdrName
700 eqClass_RDR = nameRdrName eqClassName
701 numClass_RDR = nameRdrName numClassName
702 ordClass_RDR = nameRdrName ordClassName
703 enumClass_RDR = nameRdrName enumClassName
704 monadClass_RDR = nameRdrName monadClassName
705
706 map_RDR, append_RDR :: RdrName
707 map_RDR = nameRdrName mapName
708 append_RDR = nameRdrName appendName
709
710 foldr_RDR, build_RDR, returnM_RDR, bindM_RDR, failM_RDR
711 :: RdrName
712 foldr_RDR = nameRdrName foldrName
713 build_RDR = nameRdrName buildName
714 returnM_RDR = nameRdrName returnMName
715 bindM_RDR = nameRdrName bindMName
716 failM_RDR = nameRdrName failMName
717
718 left_RDR, right_RDR :: RdrName
719 left_RDR = nameRdrName leftDataConName
720 right_RDR = nameRdrName rightDataConName
721
722 fromEnum_RDR, toEnum_RDR :: RdrName
723 fromEnum_RDR = varQual_RDR gHC_ENUM (fsLit "fromEnum")
724 toEnum_RDR = varQual_RDR gHC_ENUM (fsLit "toEnum")
725
726 enumFrom_RDR, enumFromTo_RDR, enumFromThen_RDR, enumFromThenTo_RDR :: RdrName
727 enumFrom_RDR = nameRdrName enumFromName
728 enumFromTo_RDR = nameRdrName enumFromToName
729 enumFromThen_RDR = nameRdrName enumFromThenName
730 enumFromThenTo_RDR = nameRdrName enumFromThenToName
731
732 ratioDataCon_RDR, integerAdd_RDR, integerMul_RDR :: RdrName
733 ratioDataCon_RDR = nameRdrName ratioDataConName
734 integerAdd_RDR = nameRdrName integerAddName
735 integerMul_RDR = nameRdrName integerMulName
736
737 ioDataCon_RDR :: RdrName
738 ioDataCon_RDR = nameRdrName ioDataConName
739
740 newStablePtr_RDR :: RdrName
741 newStablePtr_RDR = nameRdrName newStablePtrName
742
743 bindIO_RDR, returnIO_RDR :: RdrName
744 bindIO_RDR = nameRdrName bindIOName
745 returnIO_RDR = nameRdrName returnIOName
746
747 fromInteger_RDR, fromRational_RDR, minus_RDR, times_RDR, plus_RDR :: RdrName
748 fromInteger_RDR = nameRdrName fromIntegerName
749 fromRational_RDR = nameRdrName fromRationalName
750 minus_RDR = nameRdrName minusName
751 times_RDR = varQual_RDR gHC_NUM (fsLit "*")
752 plus_RDR = varQual_RDR gHC_NUM (fsLit "+")
753
754 toInteger_RDR, toRational_RDR, fromIntegral_RDR :: RdrName
755 toInteger_RDR = nameRdrName toIntegerName
756 toRational_RDR = nameRdrName toRationalName
757 fromIntegral_RDR = nameRdrName fromIntegralName
758
759 fromString_RDR :: RdrName
760 fromString_RDR = nameRdrName fromStringName
761
762 fromList_RDR, fromListN_RDR, toList_RDR :: RdrName
763 fromList_RDR = nameRdrName fromListName
764 fromListN_RDR = nameRdrName fromListNName
765 toList_RDR = nameRdrName toListName
766
767 compose_RDR :: RdrName
768 compose_RDR = varQual_RDR gHC_BASE (fsLit ".")
769
770 not_RDR, getTag_RDR, dataToTag_RDR, succ_RDR, pred_RDR, minBound_RDR, maxBound_RDR,
771 and_RDR, range_RDR, inRange_RDR, index_RDR,
772 unsafeIndex_RDR, unsafeRangeSize_RDR :: RdrName
773 and_RDR = varQual_RDR gHC_CLASSES (fsLit "&&")
774 not_RDR = varQual_RDR gHC_CLASSES (fsLit "not")
775 getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag")
776 dataToTag_RDR = varQual_RDR gHC_PRIM (fsLit "dataToTag#")
777 succ_RDR = varQual_RDR gHC_ENUM (fsLit "succ")
778 pred_RDR = varQual_RDR gHC_ENUM (fsLit "pred")
779 minBound_RDR = varQual_RDR gHC_ENUM (fsLit "minBound")
780 maxBound_RDR = varQual_RDR gHC_ENUM (fsLit "maxBound")
781 range_RDR = varQual_RDR gHC_IX (fsLit "range")
782 inRange_RDR = varQual_RDR gHC_IX (fsLit "inRange")
783 index_RDR = varQual_RDR gHC_IX (fsLit "index")
784 unsafeIndex_RDR = varQual_RDR gHC_IX (fsLit "unsafeIndex")
785 unsafeRangeSize_RDR = varQual_RDR gHC_IX (fsLit "unsafeRangeSize")
786
787 readList_RDR, readListDefault_RDR, readListPrec_RDR, readListPrecDefault_RDR,
788 readPrec_RDR, parens_RDR, choose_RDR, lexP_RDR, expectP_RDR :: RdrName
789 readList_RDR = varQual_RDR gHC_READ (fsLit "readList")
790 readListDefault_RDR = varQual_RDR gHC_READ (fsLit "readListDefault")
791 readListPrec_RDR = varQual_RDR gHC_READ (fsLit "readListPrec")
792 readListPrecDefault_RDR = varQual_RDR gHC_READ (fsLit "readListPrecDefault")
793 readPrec_RDR = varQual_RDR gHC_READ (fsLit "readPrec")
794 parens_RDR = varQual_RDR gHC_READ (fsLit "parens")
795 choose_RDR = varQual_RDR gHC_READ (fsLit "choose")
796 lexP_RDR = varQual_RDR gHC_READ (fsLit "lexP")
797 expectP_RDR = varQual_RDR gHC_READ (fsLit "expectP")
798
799 readField_RDR, readFieldHash_RDR, readSymField_RDR :: RdrName
800 readField_RDR = varQual_RDR gHC_READ (fsLit "readField")
801 readFieldHash_RDR = varQual_RDR gHC_READ (fsLit "readFieldHash")
802 readSymField_RDR = varQual_RDR gHC_READ (fsLit "readSymField")
803
804 punc_RDR, ident_RDR, symbol_RDR :: RdrName
805 punc_RDR = dataQual_RDR lEX (fsLit "Punc")
806 ident_RDR = dataQual_RDR lEX (fsLit "Ident")
807 symbol_RDR = dataQual_RDR lEX (fsLit "Symbol")
808
809 step_RDR, alt_RDR, reset_RDR, prec_RDR, pfail_RDR :: RdrName
810 step_RDR = varQual_RDR rEAD_PREC (fsLit "step")
811 alt_RDR = varQual_RDR rEAD_PREC (fsLit "+++")
812 reset_RDR = varQual_RDR rEAD_PREC (fsLit "reset")
813 prec_RDR = varQual_RDR rEAD_PREC (fsLit "prec")
814 pfail_RDR = varQual_RDR rEAD_PREC (fsLit "pfail")
815
816 showsPrec_RDR, shows_RDR, showString_RDR,
817 showSpace_RDR, showCommaSpace_RDR, showParen_RDR :: RdrName
818 showsPrec_RDR = varQual_RDR gHC_SHOW (fsLit "showsPrec")
819 shows_RDR = varQual_RDR gHC_SHOW (fsLit "shows")
820 showString_RDR = varQual_RDR gHC_SHOW (fsLit "showString")
821 showSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showSpace")
822 showCommaSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showCommaSpace")
823 showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen")
824
825 error_RDR :: RdrName
826 error_RDR = varQual_RDR gHC_ERR (fsLit "error")
827
828 -- Generics (constructors and functions)
829 u1DataCon_RDR, par1DataCon_RDR, rec1DataCon_RDR,
830 k1DataCon_RDR, m1DataCon_RDR, l1DataCon_RDR, r1DataCon_RDR,
831 prodDataCon_RDR, comp1DataCon_RDR,
832 unPar1_RDR, unRec1_RDR, unK1_RDR, unComp1_RDR,
833 from_RDR, from1_RDR, to_RDR, to1_RDR,
834 datatypeName_RDR, moduleName_RDR, packageName_RDR, isNewtypeName_RDR,
835 conName_RDR, conFixity_RDR, conIsRecord_RDR, selName_RDR,
836 prefixDataCon_RDR, infixDataCon_RDR, leftAssocDataCon_RDR,
837 rightAssocDataCon_RDR, notAssocDataCon_RDR,
838 uAddrDataCon_RDR, uCharDataCon_RDR, uDoubleDataCon_RDR,
839 uFloatDataCon_RDR, uIntDataCon_RDR, uWordDataCon_RDR,
840 uAddrHash_RDR, uCharHash_RDR, uDoubleHash_RDR,
841 uFloatHash_RDR, uIntHash_RDR, uWordHash_RDR :: RdrName
842
843 u1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "U1")
844 par1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Par1")
845 rec1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Rec1")
846 k1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "K1")
847 m1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "M1")
848
849 l1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "L1")
850 r1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "R1")
851
852 prodDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit ":*:")
853 comp1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Comp1")
854
855 unPar1_RDR = varQual_RDR gHC_GENERICS (fsLit "unPar1")
856 unRec1_RDR = varQual_RDR gHC_GENERICS (fsLit "unRec1")
857 unK1_RDR = varQual_RDR gHC_GENERICS (fsLit "unK1")
858 unComp1_RDR = varQual_RDR gHC_GENERICS (fsLit "unComp1")
859
860 from_RDR = varQual_RDR gHC_GENERICS (fsLit "from")
861 from1_RDR = varQual_RDR gHC_GENERICS (fsLit "from1")
862 to_RDR = varQual_RDR gHC_GENERICS (fsLit "to")
863 to1_RDR = varQual_RDR gHC_GENERICS (fsLit "to1")
864
865 datatypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "datatypeName")
866 moduleName_RDR = varQual_RDR gHC_GENERICS (fsLit "moduleName")
867 packageName_RDR = varQual_RDR gHC_GENERICS (fsLit "packageName")
868 isNewtypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "isNewtype")
869 selName_RDR = varQual_RDR gHC_GENERICS (fsLit "selName")
870 conName_RDR = varQual_RDR gHC_GENERICS (fsLit "conName")
871 conFixity_RDR = varQual_RDR gHC_GENERICS (fsLit "conFixity")
872 conIsRecord_RDR = varQual_RDR gHC_GENERICS (fsLit "conIsRecord")
873
874 prefixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Prefix")
875 infixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Infix")
876 leftAssocDataCon_RDR = nameRdrName leftAssociativeDataConName
877 rightAssocDataCon_RDR = nameRdrName rightAssociativeDataConName
878 notAssocDataCon_RDR = nameRdrName notAssociativeDataConName
879
880 uAddrDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UAddr")
881 uCharDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UChar")
882 uDoubleDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UDouble")
883 uFloatDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UFloat")
884 uIntDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UInt")
885 uWordDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UWord")
886
887 uAddrHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uAddr#")
888 uCharHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uChar#")
889 uDoubleHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uDouble#")
890 uFloatHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uFloat#")
891 uIntHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uInt#")
892 uWordHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uWord#")
893
894 fmap_RDR, replace_RDR, pure_RDR, ap_RDR, liftA2_RDR, foldable_foldr_RDR,
895 foldMap_RDR, null_RDR, all_RDR, traverse_RDR, mempty_RDR,
896 mappend_RDR :: RdrName
897 fmap_RDR = nameRdrName fmapName
898 replace_RDR = varQual_RDR gHC_BASE (fsLit "<$")
899 pure_RDR = nameRdrName pureAName
900 ap_RDR = nameRdrName apAName
901 liftA2_RDR = varQual_RDR gHC_BASE (fsLit "liftA2")
902 foldable_foldr_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldr")
903 foldMap_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldMap")
904 null_RDR = varQual_RDR dATA_FOLDABLE (fsLit "null")
905 all_RDR = varQual_RDR dATA_FOLDABLE (fsLit "all")
906 traverse_RDR = varQual_RDR dATA_TRAVERSABLE (fsLit "traverse")
907 mempty_RDR = nameRdrName memptyName
908 mappend_RDR = nameRdrName mappendName
909
910 ----------------------
911 varQual_RDR, tcQual_RDR, clsQual_RDR, dataQual_RDR
912 :: Module -> FastString -> RdrName
913 varQual_RDR mod str = mkOrig mod (mkOccNameFS varName str)
914 tcQual_RDR mod str = mkOrig mod (mkOccNameFS tcName str)
915 clsQual_RDR mod str = mkOrig mod (mkOccNameFS clsName str)
916 dataQual_RDR mod str = mkOrig mod (mkOccNameFS dataName str)
917
918 {-
919 ************************************************************************
920 * *
921 \subsection{Known-key names}
922 * *
923 ************************************************************************
924
925 Many of these Names are not really "built in", but some parts of the
926 compiler (notably the deriving mechanism) need to mention their names,
927 and it's convenient to write them all down in one place.
928 -}
929
930 wildCardName :: Name
931 wildCardName = mkSystemVarName wildCardKey (fsLit "wild")
932
933 runMainIOName, runRWName, withDictName :: Name
934 runMainIOName = varQual gHC_TOP_HANDLER (fsLit "runMainIO") runMainKey
935 runRWName = varQual gHC_MAGIC (fsLit "runRW#") runRWKey
936 withDictName = varQual gHC_MAGIC_DICT (fsLit "withDict") withDictKey
937
938 orderingTyConName, ordLTDataConName, ordEQDataConName, ordGTDataConName :: Name
939 orderingTyConName = tcQual gHC_TYPES (fsLit "Ordering") orderingTyConKey
940 ordLTDataConName = dcQual gHC_TYPES (fsLit "LT") ordLTDataConKey
941 ordEQDataConName = dcQual gHC_TYPES (fsLit "EQ") ordEQDataConKey
942 ordGTDataConName = dcQual gHC_TYPES (fsLit "GT") ordGTDataConKey
943
944 specTyConName :: Name
945 specTyConName = tcQual gHC_TYPES (fsLit "SPEC") specTyConKey
946
947 eitherTyConName, leftDataConName, rightDataConName :: Name
948 eitherTyConName = tcQual dATA_EITHER (fsLit "Either") eitherTyConKey
949 leftDataConName = dcQual dATA_EITHER (fsLit "Left") leftDataConKey
950 rightDataConName = dcQual dATA_EITHER (fsLit "Right") rightDataConKey
951
952 -- Generics (types)
953 v1TyConName, u1TyConName, par1TyConName, rec1TyConName,
954 k1TyConName, m1TyConName, sumTyConName, prodTyConName,
955 compTyConName, rTyConName, dTyConName,
956 cTyConName, sTyConName, rec0TyConName,
957 d1TyConName, c1TyConName, s1TyConName,
958 repTyConName, rep1TyConName, uRecTyConName,
959 uAddrTyConName, uCharTyConName, uDoubleTyConName,
960 uFloatTyConName, uIntTyConName, uWordTyConName,
961 prefixIDataConName, infixIDataConName, leftAssociativeDataConName,
962 rightAssociativeDataConName, notAssociativeDataConName,
963 sourceUnpackDataConName, sourceNoUnpackDataConName,
964 noSourceUnpackednessDataConName, sourceLazyDataConName,
965 sourceStrictDataConName, noSourceStrictnessDataConName,
966 decidedLazyDataConName, decidedStrictDataConName, decidedUnpackDataConName,
967 metaDataDataConName, metaConsDataConName, metaSelDataConName :: Name
968
969 v1TyConName = tcQual gHC_GENERICS (fsLit "V1") v1TyConKey
970 u1TyConName = tcQual gHC_GENERICS (fsLit "U1") u1TyConKey
971 par1TyConName = tcQual gHC_GENERICS (fsLit "Par1") par1TyConKey
972 rec1TyConName = tcQual gHC_GENERICS (fsLit "Rec1") rec1TyConKey
973 k1TyConName = tcQual gHC_GENERICS (fsLit "K1") k1TyConKey
974 m1TyConName = tcQual gHC_GENERICS (fsLit "M1") m1TyConKey
975
976 sumTyConName = tcQual gHC_GENERICS (fsLit ":+:") sumTyConKey
977 prodTyConName = tcQual gHC_GENERICS (fsLit ":*:") prodTyConKey
978 compTyConName = tcQual gHC_GENERICS (fsLit ":.:") compTyConKey
979
980 rTyConName = tcQual gHC_GENERICS (fsLit "R") rTyConKey
981 dTyConName = tcQual gHC_GENERICS (fsLit "D") dTyConKey
982 cTyConName = tcQual gHC_GENERICS (fsLit "C") cTyConKey
983 sTyConName = tcQual gHC_GENERICS (fsLit "S") sTyConKey
984
985 rec0TyConName = tcQual gHC_GENERICS (fsLit "Rec0") rec0TyConKey
986 d1TyConName = tcQual gHC_GENERICS (fsLit "D1") d1TyConKey
987 c1TyConName = tcQual gHC_GENERICS (fsLit "C1") c1TyConKey
988 s1TyConName = tcQual gHC_GENERICS (fsLit "S1") s1TyConKey
989
990 repTyConName = tcQual gHC_GENERICS (fsLit "Rep") repTyConKey
991 rep1TyConName = tcQual gHC_GENERICS (fsLit "Rep1") rep1TyConKey
992
993 uRecTyConName = tcQual gHC_GENERICS (fsLit "URec") uRecTyConKey
994 uAddrTyConName = tcQual gHC_GENERICS (fsLit "UAddr") uAddrTyConKey
995 uCharTyConName = tcQual gHC_GENERICS (fsLit "UChar") uCharTyConKey
996 uDoubleTyConName = tcQual gHC_GENERICS (fsLit "UDouble") uDoubleTyConKey
997 uFloatTyConName = tcQual gHC_GENERICS (fsLit "UFloat") uFloatTyConKey
998 uIntTyConName = tcQual gHC_GENERICS (fsLit "UInt") uIntTyConKey
999 uWordTyConName = tcQual gHC_GENERICS (fsLit "UWord") uWordTyConKey
1000
1001 prefixIDataConName = dcQual gHC_GENERICS (fsLit "PrefixI") prefixIDataConKey
1002 infixIDataConName = dcQual gHC_GENERICS (fsLit "InfixI") infixIDataConKey
1003 leftAssociativeDataConName = dcQual gHC_GENERICS (fsLit "LeftAssociative") leftAssociativeDataConKey
1004 rightAssociativeDataConName = dcQual gHC_GENERICS (fsLit "RightAssociative") rightAssociativeDataConKey
1005 notAssociativeDataConName = dcQual gHC_GENERICS (fsLit "NotAssociative") notAssociativeDataConKey
1006
1007 sourceUnpackDataConName = dcQual gHC_GENERICS (fsLit "SourceUnpack") sourceUnpackDataConKey
1008 sourceNoUnpackDataConName = dcQual gHC_GENERICS (fsLit "SourceNoUnpack") sourceNoUnpackDataConKey
1009 noSourceUnpackednessDataConName = dcQual gHC_GENERICS (fsLit "NoSourceUnpackedness") noSourceUnpackednessDataConKey
1010 sourceLazyDataConName = dcQual gHC_GENERICS (fsLit "SourceLazy") sourceLazyDataConKey
1011 sourceStrictDataConName = dcQual gHC_GENERICS (fsLit "SourceStrict") sourceStrictDataConKey
1012 noSourceStrictnessDataConName = dcQual gHC_GENERICS (fsLit "NoSourceStrictness") noSourceStrictnessDataConKey
1013 decidedLazyDataConName = dcQual gHC_GENERICS (fsLit "DecidedLazy") decidedLazyDataConKey
1014 decidedStrictDataConName = dcQual gHC_GENERICS (fsLit "DecidedStrict") decidedStrictDataConKey
1015 decidedUnpackDataConName = dcQual gHC_GENERICS (fsLit "DecidedUnpack") decidedUnpackDataConKey
1016
1017 metaDataDataConName = dcQual gHC_GENERICS (fsLit "MetaData") metaDataDataConKey
1018 metaConsDataConName = dcQual gHC_GENERICS (fsLit "MetaCons") metaConsDataConKey
1019 metaSelDataConName = dcQual gHC_GENERICS (fsLit "MetaSel") metaSelDataConKey
1020
1021 -- Primitive Int
1022 divIntName, modIntName :: Name
1023 divIntName = varQual gHC_CLASSES (fsLit "divInt#") divIntIdKey
1024 modIntName = varQual gHC_CLASSES (fsLit "modInt#") modIntIdKey
1025
1026 -- Base strings Strings
1027 unpackCStringName, unpackCStringFoldrName,
1028 unpackCStringUtf8Name, unpackCStringFoldrUtf8Name,
1029 unpackCStringAppendName, unpackCStringAppendUtf8Name,
1030 eqStringName, cstringLengthName :: Name
1031 cstringLengthName = varQual gHC_CSTRING (fsLit "cstringLength#") cstringLengthIdKey
1032 eqStringName = varQual gHC_BASE (fsLit "eqString") eqStringIdKey
1033
1034 unpackCStringName = varQual gHC_CSTRING (fsLit "unpackCString#") unpackCStringIdKey
1035 unpackCStringAppendName = varQual gHC_CSTRING (fsLit "unpackAppendCString#") unpackCStringAppendIdKey
1036 unpackCStringFoldrName = varQual gHC_CSTRING (fsLit "unpackFoldrCString#") unpackCStringFoldrIdKey
1037
1038 unpackCStringUtf8Name = varQual gHC_CSTRING (fsLit "unpackCStringUtf8#") unpackCStringUtf8IdKey
1039 unpackCStringAppendUtf8Name = varQual gHC_CSTRING (fsLit "unpackAppendCStringUtf8#") unpackCStringAppendUtf8IdKey
1040 unpackCStringFoldrUtf8Name = varQual gHC_CSTRING (fsLit "unpackFoldrCStringUtf8#") unpackCStringFoldrUtf8IdKey
1041
1042
1043 -- The 'inline' function
1044 inlineIdName :: Name
1045 inlineIdName = varQual gHC_MAGIC (fsLit "inline") inlineIdKey
1046
1047 -- Base classes (Eq, Ord, Functor)
1048 fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name
1049 eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey
1050 eqName = varQual gHC_CLASSES (fsLit "==") eqClassOpKey
1051 ordClassName = clsQual gHC_CLASSES (fsLit "Ord") ordClassKey
1052 geName = varQual gHC_CLASSES (fsLit ">=") geClassOpKey
1053 functorClassName = clsQual gHC_BASE (fsLit "Functor") functorClassKey
1054 fmapName = varQual gHC_BASE (fsLit "fmap") fmapClassOpKey
1055
1056 -- Class Monad
1057 monadClassName, thenMName, bindMName, returnMName :: Name
1058 monadClassName = clsQual gHC_BASE (fsLit "Monad") monadClassKey
1059 thenMName = varQual gHC_BASE (fsLit ">>") thenMClassOpKey
1060 bindMName = varQual gHC_BASE (fsLit ">>=") bindMClassOpKey
1061 returnMName = varQual gHC_BASE (fsLit "return") returnMClassOpKey
1062
1063 -- Class MonadFail
1064 monadFailClassName, failMName :: Name
1065 monadFailClassName = clsQual mONAD_FAIL (fsLit "MonadFail") monadFailClassKey
1066 failMName = varQual mONAD_FAIL (fsLit "fail") failMClassOpKey
1067
1068 -- Class Applicative
1069 applicativeClassName, pureAName, apAName, thenAName :: Name
1070 applicativeClassName = clsQual gHC_BASE (fsLit "Applicative") applicativeClassKey
1071 apAName = varQual gHC_BASE (fsLit "<*>") apAClassOpKey
1072 pureAName = varQual gHC_BASE (fsLit "pure") pureAClassOpKey
1073 thenAName = varQual gHC_BASE (fsLit "*>") thenAClassOpKey
1074
1075 -- Classes (Foldable, Traversable)
1076 foldableClassName, traversableClassName :: Name
1077 foldableClassName = clsQual dATA_FOLDABLE (fsLit "Foldable") foldableClassKey
1078 traversableClassName = clsQual dATA_TRAVERSABLE (fsLit "Traversable") traversableClassKey
1079
1080 -- Classes (Semigroup, Monoid)
1081 semigroupClassName, sappendName :: Name
1082 semigroupClassName = clsQual gHC_BASE (fsLit "Semigroup") semigroupClassKey
1083 sappendName = varQual gHC_BASE (fsLit "<>") sappendClassOpKey
1084 monoidClassName, memptyName, mappendName, mconcatName :: Name
1085 monoidClassName = clsQual gHC_BASE (fsLit "Monoid") monoidClassKey
1086 memptyName = varQual gHC_BASE (fsLit "mempty") memptyClassOpKey
1087 mappendName = varQual gHC_BASE (fsLit "mappend") mappendClassOpKey
1088 mconcatName = varQual gHC_BASE (fsLit "mconcat") mconcatClassOpKey
1089
1090
1091
1092 -- AMP additions
1093
1094 joinMName, alternativeClassName :: Name
1095 joinMName = varQual gHC_BASE (fsLit "join") joinMIdKey
1096 alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey
1097
1098 --
1099 joinMIdKey, apAClassOpKey, pureAClassOpKey, thenAClassOpKey,
1100 alternativeClassKey :: Unique
1101 joinMIdKey = mkPreludeMiscIdUnique 750
1102 apAClassOpKey = mkPreludeMiscIdUnique 751 -- <*>
1103 pureAClassOpKey = mkPreludeMiscIdUnique 752
1104 thenAClassOpKey = mkPreludeMiscIdUnique 753
1105 alternativeClassKey = mkPreludeMiscIdUnique 754
1106
1107
1108 -- Functions for GHC extensions
1109 groupWithName, considerAccessibleName :: Name
1110 groupWithName = varQual gHC_EXTS (fsLit "groupWith") groupWithIdKey
1111 considerAccessibleName = varQual gHC_EXTS (fsLit "considerAccessible") considerAccessibleIdKey
1112
1113 -- Random GHC.Base functions
1114 fromStringName, otherwiseIdName, foldrName, buildName, augmentName,
1115 mapName, appendName, assertName,
1116 dollarName :: Name
1117 dollarName = varQual gHC_BASE (fsLit "$") dollarIdKey
1118 otherwiseIdName = varQual gHC_BASE (fsLit "otherwise") otherwiseIdKey
1119 foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey
1120 buildName = varQual gHC_BASE (fsLit "build") buildIdKey
1121 augmentName = varQual gHC_BASE (fsLit "augment") augmentIdKey
1122 mapName = varQual gHC_BASE (fsLit "map") mapIdKey
1123 appendName = varQual gHC_BASE (fsLit "++") appendIdKey
1124 assertName = varQual gHC_BASE (fsLit "assert") assertIdKey
1125 fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
1126
1127 -- Module GHC.Num
1128 numClassName, fromIntegerName, minusName, negateName :: Name
1129 numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey
1130 fromIntegerName = varQual gHC_NUM (fsLit "fromInteger") fromIntegerClassOpKey
1131 minusName = varQual gHC_NUM (fsLit "-") minusClassOpKey
1132 negateName = varQual gHC_NUM (fsLit "negate") negateClassOpKey
1133
1134 ---------------------------------
1135 -- ghc-bignum
1136 ---------------------------------
1137 integerFromNaturalName
1138 , integerToNaturalClampName
1139 , integerToNaturalThrowName
1140 , integerToNaturalName
1141 , integerToWordName
1142 , integerToIntName
1143 , integerToWord64Name
1144 , integerToInt64Name
1145 , integerFromWordName
1146 , integerFromWord64Name
1147 , integerFromInt64Name
1148 , integerAddName
1149 , integerMulName
1150 , integerSubName
1151 , integerNegateName
1152 , integerAbsName
1153 , integerPopCountName
1154 , integerQuotName
1155 , integerRemName
1156 , integerDivName
1157 , integerModName
1158 , integerDivModName
1159 , integerQuotRemName
1160 , integerEncodeFloatName
1161 , integerEncodeDoubleName
1162 , integerGcdName
1163 , integerLcmName
1164 , integerAndName
1165 , integerOrName
1166 , integerXorName
1167 , integerComplementName
1168 , integerBitName
1169 , integerTestBitName
1170 , integerShiftLName
1171 , integerShiftRName
1172 , naturalToWordName
1173 , naturalPopCountName
1174 , naturalShiftRName
1175 , naturalShiftLName
1176 , naturalAddName
1177 , naturalSubName
1178 , naturalSubThrowName
1179 , naturalSubUnsafeName
1180 , naturalMulName
1181 , naturalQuotRemName
1182 , naturalQuotName
1183 , naturalRemName
1184 , naturalAndName
1185 , naturalAndNotName
1186 , naturalOrName
1187 , naturalXorName
1188 , naturalTestBitName
1189 , naturalBitName
1190 , naturalGcdName
1191 , naturalLcmName
1192 , naturalLog2Name
1193 , naturalLogBaseWordName
1194 , naturalLogBaseName
1195 , naturalPowModName
1196 , naturalSizeInBaseName
1197 , bignatFromWordListName
1198 , bignatEqName
1199 , bignatCompareName
1200 , bignatCompareWordName
1201 :: Name
1202
1203 bnbVarQual, bnnVarQual, bniVarQual :: String -> Unique -> Name
1204 bnbVarQual str key = varQual gHC_NUM_BIGNAT (fsLit str) key
1205 bnnVarQual str key = varQual gHC_NUM_NATURAL (fsLit str) key
1206 bniVarQual str key = varQual gHC_NUM_INTEGER (fsLit str) key
1207
1208 -- Types and DataCons
1209 bignatFromWordListName = bnbVarQual "bigNatFromWordList#" bignatFromWordListIdKey
1210 bignatEqName = bnbVarQual "bigNatEq#" bignatEqIdKey
1211 bignatCompareName = bnbVarQual "bigNatCompare" bignatCompareIdKey
1212 bignatCompareWordName = bnbVarQual "bigNatCompareWord#" bignatCompareWordIdKey
1213
1214 naturalToWordName = bnnVarQual "naturalToWord#" naturalToWordIdKey
1215 naturalPopCountName = bnnVarQual "naturalPopCount#" naturalPopCountIdKey
1216 naturalShiftRName = bnnVarQual "naturalShiftR#" naturalShiftRIdKey
1217 naturalShiftLName = bnnVarQual "naturalShiftL#" naturalShiftLIdKey
1218 naturalAddName = bnnVarQual "naturalAdd" naturalAddIdKey
1219 naturalSubName = bnnVarQual "naturalSub" naturalSubIdKey
1220 naturalSubThrowName = bnnVarQual "naturalSubThrow" naturalSubThrowIdKey
1221 naturalSubUnsafeName = bnnVarQual "naturalSubUnsafe" naturalSubUnsafeIdKey
1222 naturalMulName = bnnVarQual "naturalMul" naturalMulIdKey
1223 naturalQuotRemName = bnnVarQual "naturalQuotRem#" naturalQuotRemIdKey
1224 naturalQuotName = bnnVarQual "naturalQuot" naturalQuotIdKey
1225 naturalRemName = bnnVarQual "naturalRem" naturalRemIdKey
1226 naturalAndName = bnnVarQual "naturalAnd" naturalAndIdKey
1227 naturalAndNotName = bnnVarQual "naturalAndNot" naturalAndNotIdKey
1228 naturalOrName = bnnVarQual "naturalOr" naturalOrIdKey
1229 naturalXorName = bnnVarQual "naturalXor" naturalXorIdKey
1230 naturalTestBitName = bnnVarQual "naturalTestBit#" naturalTestBitIdKey
1231 naturalBitName = bnnVarQual "naturalBit#" naturalBitIdKey
1232 naturalGcdName = bnnVarQual "naturalGcd" naturalGcdIdKey
1233 naturalLcmName = bnnVarQual "naturalLcm" naturalLcmIdKey
1234 naturalLog2Name = bnnVarQual "naturalLog2#" naturalLog2IdKey
1235 naturalLogBaseWordName = bnnVarQual "naturalLogBaseWord#" naturalLogBaseWordIdKey
1236 naturalLogBaseName = bnnVarQual "naturalLogBase#" naturalLogBaseIdKey
1237 naturalPowModName = bnnVarQual "naturalPowMod" naturalPowModIdKey
1238 naturalSizeInBaseName = bnnVarQual "naturalSizeInBase#" naturalSizeInBaseIdKey
1239
1240 integerFromNaturalName = bniVarQual "integerFromNatural" integerFromNaturalIdKey
1241 integerToNaturalClampName = bniVarQual "integerToNaturalClamp" integerToNaturalClampIdKey
1242 integerToNaturalThrowName = bniVarQual "integerToNaturalThrow" integerToNaturalThrowIdKey
1243 integerToNaturalName = bniVarQual "integerToNatural" integerToNaturalIdKey
1244 integerToWordName = bniVarQual "integerToWord#" integerToWordIdKey
1245 integerToIntName = bniVarQual "integerToInt#" integerToIntIdKey
1246 integerToWord64Name = bniVarQual "integerToWord64#" integerToWord64IdKey
1247 integerToInt64Name = bniVarQual "integerToInt64#" integerToInt64IdKey
1248 integerFromWordName = bniVarQual "integerFromWord#" integerFromWordIdKey
1249 integerFromWord64Name = bniVarQual "integerFromWord64#" integerFromWord64IdKey
1250 integerFromInt64Name = bniVarQual "integerFromInt64#" integerFromInt64IdKey
1251 integerAddName = bniVarQual "integerAdd" integerAddIdKey
1252 integerMulName = bniVarQual "integerMul" integerMulIdKey
1253 integerSubName = bniVarQual "integerSub" integerSubIdKey
1254 integerNegateName = bniVarQual "integerNegate" integerNegateIdKey
1255 integerAbsName = bniVarQual "integerAbs" integerAbsIdKey
1256 integerPopCountName = bniVarQual "integerPopCount#" integerPopCountIdKey
1257 integerQuotName = bniVarQual "integerQuot" integerQuotIdKey
1258 integerRemName = bniVarQual "integerRem" integerRemIdKey
1259 integerDivName = bniVarQual "integerDiv" integerDivIdKey
1260 integerModName = bniVarQual "integerMod" integerModIdKey
1261 integerDivModName = bniVarQual "integerDivMod#" integerDivModIdKey
1262 integerQuotRemName = bniVarQual "integerQuotRem#" integerQuotRemIdKey
1263 integerEncodeFloatName = bniVarQual "integerEncodeFloat#" integerEncodeFloatIdKey
1264 integerEncodeDoubleName = bniVarQual "integerEncodeDouble#" integerEncodeDoubleIdKey
1265 integerGcdName = bniVarQual "integerGcd" integerGcdIdKey
1266 integerLcmName = bniVarQual "integerLcm" integerLcmIdKey
1267 integerAndName = bniVarQual "integerAnd" integerAndIdKey
1268 integerOrName = bniVarQual "integerOr" integerOrIdKey
1269 integerXorName = bniVarQual "integerXor" integerXorIdKey
1270 integerComplementName = bniVarQual "integerComplement" integerComplementIdKey
1271 integerBitName = bniVarQual "integerBit#" integerBitIdKey
1272 integerTestBitName = bniVarQual "integerTestBit#" integerTestBitIdKey
1273 integerShiftLName = bniVarQual "integerShiftL#" integerShiftLIdKey
1274 integerShiftRName = bniVarQual "integerShiftR#" integerShiftRIdKey
1275
1276
1277
1278 ---------------------------------
1279 -- End of ghc-bignum
1280 ---------------------------------
1281
1282 -- GHC.Real types and classes
1283 rationalTyConName, ratioTyConName, ratioDataConName, realClassName,
1284 integralClassName, realFracClassName, fractionalClassName,
1285 fromRationalName, toIntegerName, toRationalName, fromIntegralName,
1286 realToFracName, mkRationalBase2Name, mkRationalBase10Name :: Name
1287 rationalTyConName = tcQual gHC_REAL (fsLit "Rational") rationalTyConKey
1288 ratioTyConName = tcQual gHC_REAL (fsLit "Ratio") ratioTyConKey
1289 ratioDataConName = dcQual gHC_REAL (fsLit ":%") ratioDataConKey
1290 realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey
1291 integralClassName = clsQual gHC_REAL (fsLit "Integral") integralClassKey
1292 realFracClassName = clsQual gHC_REAL (fsLit "RealFrac") realFracClassKey
1293 fractionalClassName = clsQual gHC_REAL (fsLit "Fractional") fractionalClassKey
1294 fromRationalName = varQual gHC_REAL (fsLit "fromRational") fromRationalClassOpKey
1295 toIntegerName = varQual gHC_REAL (fsLit "toInteger") toIntegerClassOpKey
1296 toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey
1297 fromIntegralName = varQual gHC_REAL (fsLit "fromIntegral")fromIntegralIdKey
1298 realToFracName = varQual gHC_REAL (fsLit "realToFrac") realToFracIdKey
1299 mkRationalBase2Name = varQual gHC_REAL (fsLit "mkRationalBase2") mkRationalBase2IdKey
1300 mkRationalBase10Name = varQual gHC_REAL (fsLit "mkRationalBase10") mkRationalBase10IdKey
1301 -- GHC.Float classes
1302 floatingClassName, realFloatClassName :: Name
1303 floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey
1304 realFloatClassName = clsQual gHC_FLOAT (fsLit "RealFloat") realFloatClassKey
1305
1306 -- other GHC.Float functions
1307 integerToFloatName, integerToDoubleName,
1308 naturalToFloatName, naturalToDoubleName,
1309 rationalToFloatName, rationalToDoubleName :: Name
1310 integerToFloatName = varQual gHC_FLOAT (fsLit "integerToFloat#") integerToFloatIdKey
1311 integerToDoubleName = varQual gHC_FLOAT (fsLit "integerToDouble#") integerToDoubleIdKey
1312 naturalToFloatName = varQual gHC_FLOAT (fsLit "naturalToFloat#") naturalToFloatIdKey
1313 naturalToDoubleName = varQual gHC_FLOAT (fsLit "naturalToDouble#") naturalToDoubleIdKey
1314 rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey
1315 rationalToDoubleName = varQual gHC_FLOAT (fsLit "rationalToDouble") rationalToDoubleIdKey
1316
1317 -- Class Ix
1318 ixClassName :: Name
1319 ixClassName = clsQual gHC_IX (fsLit "Ix") ixClassKey
1320
1321 -- Typeable representation types
1322 trModuleTyConName
1323 , trModuleDataConName
1324 , trNameTyConName
1325 , trNameSDataConName
1326 , trNameDDataConName
1327 , trTyConTyConName
1328 , trTyConDataConName
1329 :: Name
1330 trModuleTyConName = tcQual gHC_TYPES (fsLit "Module") trModuleTyConKey
1331 trModuleDataConName = dcQual gHC_TYPES (fsLit "Module") trModuleDataConKey
1332 trNameTyConName = tcQual gHC_TYPES (fsLit "TrName") trNameTyConKey
1333 trNameSDataConName = dcQual gHC_TYPES (fsLit "TrNameS") trNameSDataConKey
1334 trNameDDataConName = dcQual gHC_TYPES (fsLit "TrNameD") trNameDDataConKey
1335 trTyConTyConName = tcQual gHC_TYPES (fsLit "TyCon") trTyConTyConKey
1336 trTyConDataConName = dcQual gHC_TYPES (fsLit "TyCon") trTyConDataConKey
1337
1338 kindRepTyConName
1339 , kindRepTyConAppDataConName
1340 , kindRepVarDataConName
1341 , kindRepAppDataConName
1342 , kindRepFunDataConName
1343 , kindRepTYPEDataConName
1344 , kindRepTypeLitSDataConName
1345 , kindRepTypeLitDDataConName
1346 :: Name
1347 kindRepTyConName = tcQual gHC_TYPES (fsLit "KindRep") kindRepTyConKey
1348 kindRepTyConAppDataConName = dcQual gHC_TYPES (fsLit "KindRepTyConApp") kindRepTyConAppDataConKey
1349 kindRepVarDataConName = dcQual gHC_TYPES (fsLit "KindRepVar") kindRepVarDataConKey
1350 kindRepAppDataConName = dcQual gHC_TYPES (fsLit "KindRepApp") kindRepAppDataConKey
1351 kindRepFunDataConName = dcQual gHC_TYPES (fsLit "KindRepFun") kindRepFunDataConKey
1352 kindRepTYPEDataConName = dcQual gHC_TYPES (fsLit "KindRepTYPE") kindRepTYPEDataConKey
1353 kindRepTypeLitSDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitS") kindRepTypeLitSDataConKey
1354 kindRepTypeLitDDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitD") kindRepTypeLitDDataConKey
1355
1356 typeLitSortTyConName
1357 , typeLitSymbolDataConName
1358 , typeLitNatDataConName
1359 , typeLitCharDataConName
1360 :: Name
1361 typeLitSortTyConName = tcQual gHC_TYPES (fsLit "TypeLitSort") typeLitSortTyConKey
1362 typeLitSymbolDataConName = dcQual gHC_TYPES (fsLit "TypeLitSymbol") typeLitSymbolDataConKey
1363 typeLitNatDataConName = dcQual gHC_TYPES (fsLit "TypeLitNat") typeLitNatDataConKey
1364 typeLitCharDataConName = dcQual gHC_TYPES (fsLit "TypeLitChar") typeLitCharDataConKey
1365
1366 -- Class Typeable, and functions for constructing `Typeable` dictionaries
1367 typeableClassName
1368 , typeRepTyConName
1369 , someTypeRepTyConName
1370 , someTypeRepDataConName
1371 , mkTrTypeName
1372 , mkTrConName
1373 , mkTrAppName
1374 , mkTrFunName
1375 , typeRepIdName
1376 , typeNatTypeRepName
1377 , typeSymbolTypeRepName
1378 , typeCharTypeRepName
1379 , trGhcPrimModuleName
1380 :: Name
1381 typeableClassName = clsQual tYPEABLE_INTERNAL (fsLit "Typeable") typeableClassKey
1382 typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey
1383 someTypeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepTyConKey
1384 someTypeRepDataConName = dcQual tYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepDataConKey
1385 typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
1386 mkTrTypeName = varQual tYPEABLE_INTERNAL (fsLit "mkTrType") mkTrTypeKey
1387 mkTrConName = varQual tYPEABLE_INTERNAL (fsLit "mkTrCon") mkTrConKey
1388 mkTrAppName = varQual tYPEABLE_INTERNAL (fsLit "mkTrApp") mkTrAppKey
1389 mkTrFunName = varQual tYPEABLE_INTERNAL (fsLit "mkTrFun") mkTrFunKey
1390 typeNatTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeNatTypeRep") typeNatTypeRepKey
1391 typeSymbolTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeSymbolTypeRep") typeSymbolTypeRepKey
1392 typeCharTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeCharTypeRep") typeCharTypeRepKey
1393 -- this is the Typeable 'Module' for GHC.Prim (which has no code, so we place in GHC.Types)
1394 -- See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeable.
1395 trGhcPrimModuleName = varQual gHC_TYPES (fsLit "tr$ModuleGHCPrim") trGhcPrimModuleKey
1396
1397 -- Typeable KindReps for some common cases
1398 starKindRepName, starArrStarKindRepName, starArrStarArrStarKindRepName :: Name
1399 starKindRepName = varQual gHC_TYPES (fsLit "krep$*") starKindRepKey
1400 starArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*Arr*") starArrStarKindRepKey
1401 starArrStarArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*->*->*") starArrStarArrStarKindRepKey
1402
1403 -- Custom type errors
1404 errorMessageTypeErrorFamName
1405 , typeErrorTextDataConName
1406 , typeErrorAppendDataConName
1407 , typeErrorVAppendDataConName
1408 , typeErrorShowTypeDataConName
1409 :: Name
1410
1411 errorMessageTypeErrorFamName =
1412 tcQual gHC_TYPEERROR (fsLit "TypeError") errorMessageTypeErrorFamKey
1413
1414 typeErrorTextDataConName =
1415 dcQual gHC_TYPEERROR (fsLit "Text") typeErrorTextDataConKey
1416
1417 typeErrorAppendDataConName =
1418 dcQual gHC_TYPEERROR (fsLit ":<>:") typeErrorAppendDataConKey
1419
1420 typeErrorVAppendDataConName =
1421 dcQual gHC_TYPEERROR (fsLit ":$$:") typeErrorVAppendDataConKey
1422
1423 typeErrorShowTypeDataConName =
1424 dcQual gHC_TYPEERROR (fsLit "ShowType") typeErrorShowTypeDataConKey
1425
1426 -- Unsafe coercion proofs
1427 unsafeEqualityProofName, unsafeEqualityTyConName, unsafeCoercePrimName,
1428 unsafeReflDataConName :: Name
1429 unsafeEqualityProofName = varQual uNSAFE_COERCE (fsLit "unsafeEqualityProof") unsafeEqualityProofIdKey
1430 unsafeEqualityTyConName = tcQual uNSAFE_COERCE (fsLit "UnsafeEquality") unsafeEqualityTyConKey
1431 unsafeReflDataConName = dcQual uNSAFE_COERCE (fsLit "UnsafeRefl") unsafeReflDataConKey
1432 unsafeCoercePrimName = varQual uNSAFE_COERCE (fsLit "unsafeCoerce#") unsafeCoercePrimIdKey
1433
1434 -- Dynamic
1435 toDynName :: Name
1436 toDynName = varQual dYNAMIC (fsLit "toDyn") toDynIdKey
1437
1438 -- Class Data
1439 dataClassName :: Name
1440 dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey
1441
1442 -- Error module
1443 assertErrorName :: Name
1444 assertErrorName = varQual gHC_IO_Exception (fsLit "assertError") assertErrorIdKey
1445
1446 -- Debug.Trace
1447 traceName :: Name
1448 traceName = varQual dEBUG_TRACE (fsLit "trace") traceKey
1449
1450 -- Enum module (Enum, Bounded)
1451 enumClassName, enumFromName, enumFromToName, enumFromThenName,
1452 enumFromThenToName, boundedClassName :: Name
1453 enumClassName = clsQual gHC_ENUM (fsLit "Enum") enumClassKey
1454 enumFromName = varQual gHC_ENUM (fsLit "enumFrom") enumFromClassOpKey
1455 enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey
1456 enumFromThenName = varQual gHC_ENUM (fsLit "enumFromThen") enumFromThenClassOpKey
1457 enumFromThenToName = varQual gHC_ENUM (fsLit "enumFromThenTo") enumFromThenToClassOpKey
1458 boundedClassName = clsQual gHC_ENUM (fsLit "Bounded") boundedClassKey
1459
1460 -- List functions
1461 concatName, filterName, zipName :: Name
1462 concatName = varQual gHC_LIST (fsLit "concat") concatIdKey
1463 filterName = varQual gHC_LIST (fsLit "filter") filterIdKey
1464 zipName = varQual gHC_LIST (fsLit "zip") zipIdKey
1465
1466 -- Overloaded lists
1467 isListClassName, fromListName, fromListNName, toListName :: Name
1468 isListClassName = clsQual gHC_EXTS (fsLit "IsList") isListClassKey
1469 fromListName = varQual gHC_EXTS (fsLit "fromList") fromListClassOpKey
1470 fromListNName = varQual gHC_EXTS (fsLit "fromListN") fromListNClassOpKey
1471 toListName = varQual gHC_EXTS (fsLit "toList") toListClassOpKey
1472
1473 -- HasField class ops
1474 getFieldName, setFieldName :: Name
1475 getFieldName = varQual gHC_RECORDS (fsLit "getField") getFieldClassOpKey
1476 setFieldName = varQual gHC_RECORDS (fsLit "setField") setFieldClassOpKey
1477
1478 -- Class Show
1479 showClassName :: Name
1480 showClassName = clsQual gHC_SHOW (fsLit "Show") showClassKey
1481
1482 -- Class Read
1483 readClassName :: Name
1484 readClassName = clsQual gHC_READ (fsLit "Read") readClassKey
1485
1486 -- Classes Generic and Generic1, Datatype, Constructor and Selector
1487 genClassName, gen1ClassName, datatypeClassName, constructorClassName,
1488 selectorClassName :: Name
1489 genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey
1490 gen1ClassName = clsQual gHC_GENERICS (fsLit "Generic1") gen1ClassKey
1491
1492 datatypeClassName = clsQual gHC_GENERICS (fsLit "Datatype") datatypeClassKey
1493 constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey
1494 selectorClassName = clsQual gHC_GENERICS (fsLit "Selector") selectorClassKey
1495
1496 genericClassNames :: [Name]
1497 genericClassNames = [genClassName, gen1ClassName]
1498
1499 -- GHCi things
1500 ghciIoClassName, ghciStepIoMName :: Name
1501 ghciIoClassName = clsQual gHC_GHCI (fsLit "GHCiSandboxIO") ghciIoClassKey
1502 ghciStepIoMName = varQual gHC_GHCI (fsLit "ghciStepIO") ghciStepIoMClassOpKey
1503
1504 -- IO things
1505 ioTyConName, ioDataConName,
1506 thenIOName, bindIOName, returnIOName, failIOName :: Name
1507 ioTyConName = tcQual gHC_TYPES (fsLit "IO") ioTyConKey
1508 ioDataConName = dcQual gHC_TYPES (fsLit "IO") ioDataConKey
1509 thenIOName = varQual gHC_BASE (fsLit "thenIO") thenIOIdKey
1510 bindIOName = varQual gHC_BASE (fsLit "bindIO") bindIOIdKey
1511 returnIOName = varQual gHC_BASE (fsLit "returnIO") returnIOIdKey
1512 failIOName = varQual gHC_IO (fsLit "failIO") failIOIdKey
1513
1514 -- IO things
1515 printName :: Name
1516 printName = varQual sYSTEM_IO (fsLit "print") printIdKey
1517
1518 -- Int, Word, and Addr things
1519 int8TyConName, int16TyConName, int32TyConName, int64TyConName :: Name
1520 int8TyConName = tcQual gHC_INT (fsLit "Int8") int8TyConKey
1521 int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey
1522 int32TyConName = tcQual gHC_INT (fsLit "Int32") int32TyConKey
1523 int64TyConName = tcQual gHC_INT (fsLit "Int64") int64TyConKey
1524
1525 -- Word module
1526 word8TyConName, word16TyConName, word32TyConName, word64TyConName :: Name
1527 word8TyConName = tcQual gHC_WORD (fsLit "Word8") word8TyConKey
1528 word16TyConName = tcQual gHC_WORD (fsLit "Word16") word16TyConKey
1529 word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
1530 word64TyConName = tcQual gHC_WORD (fsLit "Word64") word64TyConKey
1531
1532 -- PrelPtr module
1533 ptrTyConName, funPtrTyConName :: Name
1534 ptrTyConName = tcQual gHC_PTR (fsLit "Ptr") ptrTyConKey
1535 funPtrTyConName = tcQual gHC_PTR (fsLit "FunPtr") funPtrTyConKey
1536
1537 -- Foreign objects and weak pointers
1538 stablePtrTyConName, newStablePtrName :: Name
1539 stablePtrTyConName = tcQual gHC_STABLE (fsLit "StablePtr") stablePtrTyConKey
1540 newStablePtrName = varQual gHC_STABLE (fsLit "newStablePtr") newStablePtrIdKey
1541
1542 -- Recursive-do notation
1543 monadFixClassName, mfixName :: Name
1544 monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey
1545 mfixName = varQual mONAD_FIX (fsLit "mfix") mfixIdKey
1546
1547 -- Arrow notation
1548 arrAName, composeAName, firstAName, appAName, choiceAName, loopAName :: Name
1549 arrAName = varQual aRROW (fsLit "arr") arrAIdKey
1550 composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey
1551 firstAName = varQual aRROW (fsLit "first") firstAIdKey
1552 appAName = varQual aRROW (fsLit "app") appAIdKey
1553 choiceAName = varQual aRROW (fsLit "|||") choiceAIdKey
1554 loopAName = varQual aRROW (fsLit "loop") loopAIdKey
1555
1556 -- Monad comprehensions
1557 guardMName, liftMName, mzipName :: Name
1558 guardMName = varQual mONAD (fsLit "guard") guardMIdKey
1559 liftMName = varQual mONAD (fsLit "liftM") liftMIdKey
1560 mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey
1561
1562
1563 -- Annotation type checking
1564 toAnnotationWrapperName :: Name
1565 toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey
1566
1567 -- Other classes, needed for type defaulting
1568 monadPlusClassName, randomClassName, randomGenClassName,
1569 isStringClassName :: Name
1570 monadPlusClassName = clsQual mONAD (fsLit "MonadPlus") monadPlusClassKey
1571 randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey
1572 randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey
1573 isStringClassName = clsQual dATA_STRING (fsLit "IsString") isStringClassKey
1574
1575 -- Type-level naturals
1576 knownNatClassName :: Name
1577 knownNatClassName = clsQual gHC_TYPENATS (fsLit "KnownNat") knownNatClassNameKey
1578 knownSymbolClassName :: Name
1579 knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey
1580 knownCharClassName :: Name
1581 knownCharClassName = clsQual gHC_TYPELITS (fsLit "KnownChar") knownCharClassNameKey
1582
1583 -- Overloaded labels
1584 fromLabelClassOpName :: Name
1585 fromLabelClassOpName
1586 = varQual gHC_OVER_LABELS (fsLit "fromLabel") fromLabelClassOpKey
1587
1588 -- Implicit Parameters
1589 ipClassName :: Name
1590 ipClassName
1591 = clsQual gHC_CLASSES (fsLit "IP") ipClassKey
1592
1593 -- Overloaded record fields
1594 hasFieldClassName :: Name
1595 hasFieldClassName
1596 = clsQual gHC_RECORDS (fsLit "HasField") hasFieldClassNameKey
1597
1598 -- Source Locations
1599 callStackTyConName, emptyCallStackName, pushCallStackName,
1600 srcLocDataConName :: Name
1601 callStackTyConName
1602 = tcQual gHC_STACK_TYPES (fsLit "CallStack") callStackTyConKey
1603 emptyCallStackName
1604 = varQual gHC_STACK_TYPES (fsLit "emptyCallStack") emptyCallStackKey
1605 pushCallStackName
1606 = varQual gHC_STACK_TYPES (fsLit "pushCallStack") pushCallStackKey
1607 srcLocDataConName
1608 = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey
1609
1610 -- plugins
1611 pLUGINS :: Module
1612 pLUGINS = mkThisGhcModule (fsLit "GHC.Driver.Plugins")
1613 pluginTyConName :: Name
1614 pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
1615 frontendPluginTyConName :: Name
1616 frontendPluginTyConName = tcQual pLUGINS (fsLit "FrontendPlugin") frontendPluginTyConKey
1617
1618 -- Static pointers
1619 makeStaticName :: Name
1620 makeStaticName =
1621 varQual gHC_STATICPTR_INTERNAL (fsLit "makeStatic") makeStaticKey
1622
1623 staticPtrInfoTyConName :: Name
1624 staticPtrInfoTyConName =
1625 tcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoTyConKey
1626
1627 staticPtrInfoDataConName :: Name
1628 staticPtrInfoDataConName =
1629 dcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoDataConKey
1630
1631 staticPtrTyConName :: Name
1632 staticPtrTyConName =
1633 tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
1634
1635 staticPtrDataConName :: Name
1636 staticPtrDataConName =
1637 dcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrDataConKey
1638
1639 fromStaticPtrName :: Name
1640 fromStaticPtrName =
1641 varQual gHC_STATICPTR (fsLit "fromStaticPtr") fromStaticPtrClassOpKey
1642
1643 fingerprintDataConName :: Name
1644 fingerprintDataConName =
1645 dcQual gHC_FINGERPRINT_TYPE (fsLit "Fingerprint") fingerprintDataConKey
1646
1647 {-
1648 ************************************************************************
1649 * *
1650 \subsection{Local helpers}
1651 * *
1652 ************************************************************************
1653
1654 All these are original names; hence mkOrig
1655 -}
1656
1657 {-# INLINE varQual #-}
1658 {-# INLINE tcQual #-}
1659 {-# INLINE clsQual #-}
1660 {-# INLINE dcQual #-}
1661 varQual, tcQual, clsQual, dcQual :: Module -> FastString -> Unique -> Name
1662 varQual modu str unique = mk_known_key_name varName modu str unique
1663 tcQual modu str unique = mk_known_key_name tcName modu str unique
1664 clsQual modu str unique = mk_known_key_name clsName modu str unique
1665 dcQual modu str unique = mk_known_key_name dataName modu str unique
1666
1667 mk_known_key_name :: NameSpace -> Module -> FastString -> Unique -> Name
1668 {-# INLINE mk_known_key_name #-}
1669 mk_known_key_name space modu str unique
1670 = mkExternalName unique modu (mkOccNameFS space str) noSrcSpan
1671
1672
1673 {-
1674 ************************************************************************
1675 * *
1676 \subsubsection[Uniques-prelude-Classes]{@Uniques@ for wired-in @Classes@}
1677 * *
1678 ************************************************************************
1679 --MetaHaskell extension hand allocate keys here
1680 -}
1681
1682 boundedClassKey, enumClassKey, eqClassKey, floatingClassKey,
1683 fractionalClassKey, integralClassKey, monadClassKey, dataClassKey,
1684 functorClassKey, numClassKey, ordClassKey, readClassKey, realClassKey,
1685 realFloatClassKey, realFracClassKey, showClassKey, ixClassKey :: Unique
1686 boundedClassKey = mkPreludeClassUnique 1
1687 enumClassKey = mkPreludeClassUnique 2
1688 eqClassKey = mkPreludeClassUnique 3
1689 floatingClassKey = mkPreludeClassUnique 5
1690 fractionalClassKey = mkPreludeClassUnique 6
1691 integralClassKey = mkPreludeClassUnique 7
1692 monadClassKey = mkPreludeClassUnique 8
1693 dataClassKey = mkPreludeClassUnique 9
1694 functorClassKey = mkPreludeClassUnique 10
1695 numClassKey = mkPreludeClassUnique 11
1696 ordClassKey = mkPreludeClassUnique 12
1697 readClassKey = mkPreludeClassUnique 13
1698 realClassKey = mkPreludeClassUnique 14
1699 realFloatClassKey = mkPreludeClassUnique 15
1700 realFracClassKey = mkPreludeClassUnique 16
1701 showClassKey = mkPreludeClassUnique 17
1702 ixClassKey = mkPreludeClassUnique 18
1703
1704 typeableClassKey :: Unique
1705 typeableClassKey = mkPreludeClassUnique 20
1706
1707 monadFixClassKey :: Unique
1708 monadFixClassKey = mkPreludeClassUnique 28
1709
1710 monadFailClassKey :: Unique
1711 monadFailClassKey = mkPreludeClassUnique 29
1712
1713 monadPlusClassKey, randomClassKey, randomGenClassKey :: Unique
1714 monadPlusClassKey = mkPreludeClassUnique 30
1715 randomClassKey = mkPreludeClassUnique 31
1716 randomGenClassKey = mkPreludeClassUnique 32
1717
1718 isStringClassKey :: Unique
1719 isStringClassKey = mkPreludeClassUnique 33
1720
1721 applicativeClassKey, foldableClassKey, traversableClassKey :: Unique
1722 applicativeClassKey = mkPreludeClassUnique 34
1723 foldableClassKey = mkPreludeClassUnique 35
1724 traversableClassKey = mkPreludeClassUnique 36
1725
1726 genClassKey, gen1ClassKey, datatypeClassKey, constructorClassKey,
1727 selectorClassKey :: Unique
1728 genClassKey = mkPreludeClassUnique 37
1729 gen1ClassKey = mkPreludeClassUnique 38
1730
1731 datatypeClassKey = mkPreludeClassUnique 39
1732 constructorClassKey = mkPreludeClassUnique 40
1733 selectorClassKey = mkPreludeClassUnique 41
1734
1735 -- KnownNat: see Note [KnownNat & KnownSymbol and EvLit] in GHC.Tc.Types.Evidence
1736 knownNatClassNameKey :: Unique
1737 knownNatClassNameKey = mkPreludeClassUnique 42
1738
1739 -- KnownSymbol: see Note [KnownNat & KnownSymbol and EvLit] in GHC.Tc.Types.Evidence
1740 knownSymbolClassNameKey :: Unique
1741 knownSymbolClassNameKey = mkPreludeClassUnique 43
1742
1743 knownCharClassNameKey :: Unique
1744 knownCharClassNameKey = mkPreludeClassUnique 44
1745
1746 ghciIoClassKey :: Unique
1747 ghciIoClassKey = mkPreludeClassUnique 45
1748
1749 semigroupClassKey, monoidClassKey :: Unique
1750 semigroupClassKey = mkPreludeClassUnique 47
1751 monoidClassKey = mkPreludeClassUnique 48
1752
1753 -- Implicit Parameters
1754 ipClassKey :: Unique
1755 ipClassKey = mkPreludeClassUnique 49
1756
1757 -- Overloaded record fields
1758 hasFieldClassNameKey :: Unique
1759 hasFieldClassNameKey = mkPreludeClassUnique 50
1760
1761
1762 ---------------- Template Haskell -------------------
1763 -- GHC.Builtin.Names.TH: USES ClassUniques 200-299
1764 -----------------------------------------------------
1765
1766 {-
1767 ************************************************************************
1768 * *
1769 \subsubsection[Uniques-prelude-TyCons]{@Uniques@ for wired-in @TyCons@}
1770 * *
1771 ************************************************************************
1772 -}
1773
1774 addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey,
1775 byteArrayPrimTyConKey, charPrimTyConKey, charTyConKey, doublePrimTyConKey,
1776 doubleTyConKey, floatPrimTyConKey, floatTyConKey, funTyConKey,
1777 intPrimTyConKey, intTyConKey, int8TyConKey, int16TyConKey,
1778 int8PrimTyConKey, int16PrimTyConKey, int32PrimTyConKey, int32TyConKey,
1779 int64PrimTyConKey, int64TyConKey,
1780 integerTyConKey, naturalTyConKey,
1781 listTyConKey, foreignObjPrimTyConKey, maybeTyConKey,
1782 weakPrimTyConKey, mutableArrayPrimTyConKey, mutableArrayArrayPrimTyConKey,
1783 mutableByteArrayPrimTyConKey, orderingTyConKey, mVarPrimTyConKey,
1784 ratioTyConKey, rationalTyConKey, realWorldTyConKey, stablePtrPrimTyConKey,
1785 stablePtrTyConKey, eqTyConKey, heqTyConKey, ioPortPrimTyConKey,
1786 smallArrayPrimTyConKey, smallMutableArrayPrimTyConKey,
1787 stringTyConKey :: Unique
1788 addrPrimTyConKey = mkPreludeTyConUnique 1
1789 arrayPrimTyConKey = mkPreludeTyConUnique 3
1790 boolTyConKey = mkPreludeTyConUnique 4
1791 byteArrayPrimTyConKey = mkPreludeTyConUnique 5
1792 stringTyConKey = mkPreludeTyConUnique 6
1793 charPrimTyConKey = mkPreludeTyConUnique 7
1794 charTyConKey = mkPreludeTyConUnique 8
1795 doublePrimTyConKey = mkPreludeTyConUnique 9
1796 doubleTyConKey = mkPreludeTyConUnique 10
1797 floatPrimTyConKey = mkPreludeTyConUnique 11
1798 floatTyConKey = mkPreludeTyConUnique 12
1799 funTyConKey = mkPreludeTyConUnique 13
1800 intPrimTyConKey = mkPreludeTyConUnique 14
1801 intTyConKey = mkPreludeTyConUnique 15
1802 int8PrimTyConKey = mkPreludeTyConUnique 16
1803 int8TyConKey = mkPreludeTyConUnique 17
1804 int16PrimTyConKey = mkPreludeTyConUnique 18
1805 int16TyConKey = mkPreludeTyConUnique 19
1806 int32PrimTyConKey = mkPreludeTyConUnique 20
1807 int32TyConKey = mkPreludeTyConUnique 21
1808 int64PrimTyConKey = mkPreludeTyConUnique 22
1809 int64TyConKey = mkPreludeTyConUnique 23
1810 integerTyConKey = mkPreludeTyConUnique 24
1811 naturalTyConKey = mkPreludeTyConUnique 25
1812
1813 listTyConKey = mkPreludeTyConUnique 26
1814 foreignObjPrimTyConKey = mkPreludeTyConUnique 27
1815 maybeTyConKey = mkPreludeTyConUnique 28
1816 weakPrimTyConKey = mkPreludeTyConUnique 29
1817 mutableArrayPrimTyConKey = mkPreludeTyConUnique 30
1818 mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 31
1819 orderingTyConKey = mkPreludeTyConUnique 32
1820 mVarPrimTyConKey = mkPreludeTyConUnique 33
1821 ioPortPrimTyConKey = mkPreludeTyConUnique 34
1822 ratioTyConKey = mkPreludeTyConUnique 35
1823 rationalTyConKey = mkPreludeTyConUnique 36
1824 realWorldTyConKey = mkPreludeTyConUnique 37
1825 stablePtrPrimTyConKey = mkPreludeTyConUnique 38
1826 stablePtrTyConKey = mkPreludeTyConUnique 39
1827 eqTyConKey = mkPreludeTyConUnique 40
1828 heqTyConKey = mkPreludeTyConUnique 41
1829 arrayArrayPrimTyConKey = mkPreludeTyConUnique 42
1830 mutableArrayArrayPrimTyConKey = mkPreludeTyConUnique 43
1831
1832 statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey,
1833 mutVarPrimTyConKey, ioTyConKey,
1834 wordPrimTyConKey, wordTyConKey, word8PrimTyConKey, word8TyConKey,
1835 word16PrimTyConKey, word16TyConKey, word32PrimTyConKey, word32TyConKey,
1836 word64PrimTyConKey, word64TyConKey,
1837 kindConKey, boxityConKey,
1838 typeConKey, threadIdPrimTyConKey, bcoPrimTyConKey, ptrTyConKey,
1839 funPtrTyConKey, tVarPrimTyConKey, eqPrimTyConKey,
1840 eqReprPrimTyConKey, eqPhantPrimTyConKey,
1841 compactPrimTyConKey, stackSnapshotPrimTyConKey,
1842 concretePrimTyConKey :: Unique
1843 statePrimTyConKey = mkPreludeTyConUnique 50
1844 stableNamePrimTyConKey = mkPreludeTyConUnique 51
1845 stableNameTyConKey = mkPreludeTyConUnique 52
1846 eqPrimTyConKey = mkPreludeTyConUnique 53
1847 eqReprPrimTyConKey = mkPreludeTyConUnique 54
1848 eqPhantPrimTyConKey = mkPreludeTyConUnique 55
1849 mutVarPrimTyConKey = mkPreludeTyConUnique 56
1850 ioTyConKey = mkPreludeTyConUnique 57
1851 wordPrimTyConKey = mkPreludeTyConUnique 59
1852 wordTyConKey = mkPreludeTyConUnique 60
1853 word8PrimTyConKey = mkPreludeTyConUnique 61
1854 word8TyConKey = mkPreludeTyConUnique 62
1855 word16PrimTyConKey = mkPreludeTyConUnique 63
1856 word16TyConKey = mkPreludeTyConUnique 64
1857 word32PrimTyConKey = mkPreludeTyConUnique 65
1858 word32TyConKey = mkPreludeTyConUnique 66
1859 word64PrimTyConKey = mkPreludeTyConUnique 67
1860 word64TyConKey = mkPreludeTyConUnique 68
1861 kindConKey = mkPreludeTyConUnique 72
1862 boxityConKey = mkPreludeTyConUnique 73
1863 typeConKey = mkPreludeTyConUnique 74
1864 threadIdPrimTyConKey = mkPreludeTyConUnique 75
1865 bcoPrimTyConKey = mkPreludeTyConUnique 76
1866 ptrTyConKey = mkPreludeTyConUnique 77
1867 funPtrTyConKey = mkPreludeTyConUnique 78
1868 tVarPrimTyConKey = mkPreludeTyConUnique 79
1869 compactPrimTyConKey = mkPreludeTyConUnique 80
1870 stackSnapshotPrimTyConKey = mkPreludeTyConUnique 81
1871 concretePrimTyConKey = mkPreludeTyConUnique 82
1872
1873 eitherTyConKey :: Unique
1874 eitherTyConKey = mkPreludeTyConUnique 84
1875
1876 -- Kind constructors
1877 liftedTypeKindTyConKey, unliftedTypeKindTyConKey,
1878 tYPETyConKey, liftedRepTyConKey, unliftedRepTyConKey,
1879 constraintKindTyConKey, levityTyConKey, runtimeRepTyConKey,
1880 vecCountTyConKey, vecElemTyConKey :: Unique
1881 liftedTypeKindTyConKey = mkPreludeTyConUnique 87
1882 unliftedTypeKindTyConKey = mkPreludeTyConUnique 88
1883 tYPETyConKey = mkPreludeTyConUnique 89
1884 constraintKindTyConKey = mkPreludeTyConUnique 92
1885 levityTyConKey = mkPreludeTyConUnique 94
1886 runtimeRepTyConKey = mkPreludeTyConUnique 95
1887 vecCountTyConKey = mkPreludeTyConUnique 96
1888 vecElemTyConKey = mkPreludeTyConUnique 97
1889 liftedRepTyConKey = mkPreludeTyConUnique 98
1890 unliftedRepTyConKey = mkPreludeTyConUnique 99
1891
1892 pluginTyConKey, frontendPluginTyConKey :: Unique
1893 pluginTyConKey = mkPreludeTyConUnique 102
1894 frontendPluginTyConKey = mkPreludeTyConUnique 103
1895
1896 -- Generics (Unique keys)
1897 v1TyConKey, u1TyConKey, par1TyConKey, rec1TyConKey,
1898 k1TyConKey, m1TyConKey, sumTyConKey, prodTyConKey,
1899 compTyConKey, rTyConKey, dTyConKey,
1900 cTyConKey, sTyConKey, rec0TyConKey,
1901 d1TyConKey, c1TyConKey, s1TyConKey,
1902 repTyConKey, rep1TyConKey, uRecTyConKey,
1903 uAddrTyConKey, uCharTyConKey, uDoubleTyConKey,
1904 uFloatTyConKey, uIntTyConKey, uWordTyConKey :: Unique
1905
1906 v1TyConKey = mkPreludeTyConUnique 135
1907 u1TyConKey = mkPreludeTyConUnique 136
1908 par1TyConKey = mkPreludeTyConUnique 137
1909 rec1TyConKey = mkPreludeTyConUnique 138
1910 k1TyConKey = mkPreludeTyConUnique 139
1911 m1TyConKey = mkPreludeTyConUnique 140
1912
1913 sumTyConKey = mkPreludeTyConUnique 141
1914 prodTyConKey = mkPreludeTyConUnique 142
1915 compTyConKey = mkPreludeTyConUnique 143
1916
1917 rTyConKey = mkPreludeTyConUnique 144
1918 dTyConKey = mkPreludeTyConUnique 146
1919 cTyConKey = mkPreludeTyConUnique 147
1920 sTyConKey = mkPreludeTyConUnique 148
1921
1922 rec0TyConKey = mkPreludeTyConUnique 149
1923 d1TyConKey = mkPreludeTyConUnique 151
1924 c1TyConKey = mkPreludeTyConUnique 152
1925 s1TyConKey = mkPreludeTyConUnique 153
1926
1927 repTyConKey = mkPreludeTyConUnique 155
1928 rep1TyConKey = mkPreludeTyConUnique 156
1929
1930 uRecTyConKey = mkPreludeTyConUnique 157
1931 uAddrTyConKey = mkPreludeTyConUnique 158
1932 uCharTyConKey = mkPreludeTyConUnique 159
1933 uDoubleTyConKey = mkPreludeTyConUnique 160
1934 uFloatTyConKey = mkPreludeTyConUnique 161
1935 uIntTyConKey = mkPreludeTyConUnique 162
1936 uWordTyConKey = mkPreludeTyConUnique 163
1937
1938 -- Custom user type-errors
1939 errorMessageTypeErrorFamKey :: Unique
1940 errorMessageTypeErrorFamKey = mkPreludeTyConUnique 181
1941
1942 coercibleTyConKey :: Unique
1943 coercibleTyConKey = mkPreludeTyConUnique 183
1944
1945 proxyPrimTyConKey :: Unique
1946 proxyPrimTyConKey = mkPreludeTyConUnique 184
1947
1948 specTyConKey :: Unique
1949 specTyConKey = mkPreludeTyConUnique 185
1950
1951 anyTyConKey :: Unique
1952 anyTyConKey = mkPreludeTyConUnique 186
1953
1954 smallArrayPrimTyConKey = mkPreludeTyConUnique 187
1955 smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 188
1956
1957 staticPtrTyConKey :: Unique
1958 staticPtrTyConKey = mkPreludeTyConUnique 189
1959
1960 staticPtrInfoTyConKey :: Unique
1961 staticPtrInfoTyConKey = mkPreludeTyConUnique 190
1962
1963 callStackTyConKey :: Unique
1964 callStackTyConKey = mkPreludeTyConUnique 191
1965
1966 -- Typeables
1967 typeRepTyConKey, someTypeRepTyConKey, someTypeRepDataConKey :: Unique
1968 typeRepTyConKey = mkPreludeTyConUnique 192
1969 someTypeRepTyConKey = mkPreludeTyConUnique 193
1970 someTypeRepDataConKey = mkPreludeTyConUnique 194
1971
1972
1973 typeSymbolAppendFamNameKey :: Unique
1974 typeSymbolAppendFamNameKey = mkPreludeTyConUnique 195
1975
1976 -- Unsafe equality
1977 unsafeEqualityTyConKey :: Unique
1978 unsafeEqualityTyConKey = mkPreludeTyConUnique 196
1979
1980 -- Linear types
1981 multiplicityTyConKey :: Unique
1982 multiplicityTyConKey = mkPreludeTyConUnique 197
1983
1984 unrestrictedFunTyConKey :: Unique
1985 unrestrictedFunTyConKey = mkPreludeTyConUnique 198
1986
1987 multMulTyConKey :: Unique
1988 multMulTyConKey = mkPreludeTyConUnique 199
1989
1990 ---------------- Template Haskell -------------------
1991 -- GHC.Builtin.Names.TH: USES TyConUniques 200-299
1992 -----------------------------------------------------
1993
1994 ----------------------- SIMD ------------------------
1995 -- USES TyConUniques 300-399
1996 -----------------------------------------------------
1997
1998 #include "primop-vector-uniques.hs-incl"
1999
2000 ------------- Type-level Symbol, Nat, Char ----------
2001 -- USES TyConUniques 400-499
2002 -----------------------------------------------------
2003 typeSymbolKindConNameKey, typeCharKindConNameKey,
2004 typeNatAddTyFamNameKey, typeNatMulTyFamNameKey, typeNatExpTyFamNameKey,
2005 typeNatSubTyFamNameKey
2006 , typeSymbolCmpTyFamNameKey, typeNatCmpTyFamNameKey, typeCharCmpTyFamNameKey
2007 , typeLeqCharTyFamNameKey
2008 , typeNatDivTyFamNameKey
2009 , typeNatModTyFamNameKey
2010 , typeNatLogTyFamNameKey
2011 , typeConsSymbolTyFamNameKey, typeUnconsSymbolTyFamNameKey
2012 , typeCharToNatTyFamNameKey, typeNatToCharTyFamNameKey
2013 :: Unique
2014 typeSymbolKindConNameKey = mkPreludeTyConUnique 400
2015 typeCharKindConNameKey = mkPreludeTyConUnique 401
2016 typeNatAddTyFamNameKey = mkPreludeTyConUnique 402
2017 typeNatMulTyFamNameKey = mkPreludeTyConUnique 403
2018 typeNatExpTyFamNameKey = mkPreludeTyConUnique 404
2019 typeNatSubTyFamNameKey = mkPreludeTyConUnique 405
2020 typeSymbolCmpTyFamNameKey = mkPreludeTyConUnique 406
2021 typeNatCmpTyFamNameKey = mkPreludeTyConUnique 407
2022 typeCharCmpTyFamNameKey = mkPreludeTyConUnique 408
2023 typeLeqCharTyFamNameKey = mkPreludeTyConUnique 409
2024 typeNatDivTyFamNameKey = mkPreludeTyConUnique 410
2025 typeNatModTyFamNameKey = mkPreludeTyConUnique 411
2026 typeNatLogTyFamNameKey = mkPreludeTyConUnique 412
2027 typeConsSymbolTyFamNameKey = mkPreludeTyConUnique 413
2028 typeUnconsSymbolTyFamNameKey = mkPreludeTyConUnique 414
2029 typeCharToNatTyFamNameKey = mkPreludeTyConUnique 415
2030 typeNatToCharTyFamNameKey = mkPreludeTyConUnique 416
2031
2032 {-
2033 ************************************************************************
2034 * *
2035 \subsubsection[Uniques-prelude-DataCons]{@Uniques@ for wired-in @DataCons@}
2036 * *
2037 ************************************************************************
2038 -}
2039
2040 charDataConKey, consDataConKey, doubleDataConKey, falseDataConKey,
2041 floatDataConKey, intDataConKey, nilDataConKey,
2042 ratioDataConKey, stableNameDataConKey, trueDataConKey, wordDataConKey,
2043 word8DataConKey, ioDataConKey, heqDataConKey,
2044 coercibleDataConKey, eqDataConKey, nothingDataConKey, justDataConKey :: Unique
2045
2046 charDataConKey = mkPreludeDataConUnique 1
2047 consDataConKey = mkPreludeDataConUnique 2
2048 doubleDataConKey = mkPreludeDataConUnique 3
2049 falseDataConKey = mkPreludeDataConUnique 4
2050 floatDataConKey = mkPreludeDataConUnique 5
2051 intDataConKey = mkPreludeDataConUnique 6
2052 nothingDataConKey = mkPreludeDataConUnique 7
2053 justDataConKey = mkPreludeDataConUnique 8
2054 eqDataConKey = mkPreludeDataConUnique 9
2055 nilDataConKey = mkPreludeDataConUnique 10
2056 ratioDataConKey = mkPreludeDataConUnique 11
2057 word8DataConKey = mkPreludeDataConUnique 12
2058 stableNameDataConKey = mkPreludeDataConUnique 13
2059 trueDataConKey = mkPreludeDataConUnique 14
2060 wordDataConKey = mkPreludeDataConUnique 15
2061 ioDataConKey = mkPreludeDataConUnique 16
2062 heqDataConKey = mkPreludeDataConUnique 18
2063
2064 -- Generic data constructors
2065 crossDataConKey, inlDataConKey, inrDataConKey, genUnitDataConKey :: Unique
2066 crossDataConKey = mkPreludeDataConUnique 20
2067 inlDataConKey = mkPreludeDataConUnique 21
2068 inrDataConKey = mkPreludeDataConUnique 22
2069 genUnitDataConKey = mkPreludeDataConUnique 23
2070
2071 leftDataConKey, rightDataConKey :: Unique
2072 leftDataConKey = mkPreludeDataConUnique 25
2073 rightDataConKey = mkPreludeDataConUnique 26
2074
2075 ordLTDataConKey, ordEQDataConKey, ordGTDataConKey :: Unique
2076 ordLTDataConKey = mkPreludeDataConUnique 27
2077 ordEQDataConKey = mkPreludeDataConUnique 28
2078 ordGTDataConKey = mkPreludeDataConUnique 29
2079
2080
2081 coercibleDataConKey = mkPreludeDataConUnique 32
2082
2083 staticPtrDataConKey :: Unique
2084 staticPtrDataConKey = mkPreludeDataConUnique 33
2085
2086 staticPtrInfoDataConKey :: Unique
2087 staticPtrInfoDataConKey = mkPreludeDataConUnique 34
2088
2089 fingerprintDataConKey :: Unique
2090 fingerprintDataConKey = mkPreludeDataConUnique 35
2091
2092 srcLocDataConKey :: Unique
2093 srcLocDataConKey = mkPreludeDataConUnique 37
2094
2095 trTyConTyConKey, trTyConDataConKey,
2096 trModuleTyConKey, trModuleDataConKey,
2097 trNameTyConKey, trNameSDataConKey, trNameDDataConKey,
2098 trGhcPrimModuleKey, kindRepTyConKey,
2099 typeLitSortTyConKey :: Unique
2100 trTyConTyConKey = mkPreludeDataConUnique 40
2101 trTyConDataConKey = mkPreludeDataConUnique 41
2102 trModuleTyConKey = mkPreludeDataConUnique 42
2103 trModuleDataConKey = mkPreludeDataConUnique 43
2104 trNameTyConKey = mkPreludeDataConUnique 44
2105 trNameSDataConKey = mkPreludeDataConUnique 45
2106 trNameDDataConKey = mkPreludeDataConUnique 46
2107 trGhcPrimModuleKey = mkPreludeDataConUnique 47
2108 kindRepTyConKey = mkPreludeDataConUnique 48
2109 typeLitSortTyConKey = mkPreludeDataConUnique 49
2110
2111 typeErrorTextDataConKey,
2112 typeErrorAppendDataConKey,
2113 typeErrorVAppendDataConKey,
2114 typeErrorShowTypeDataConKey
2115 :: Unique
2116 typeErrorTextDataConKey = mkPreludeDataConUnique 50
2117 typeErrorAppendDataConKey = mkPreludeDataConUnique 51
2118 typeErrorVAppendDataConKey = mkPreludeDataConUnique 52
2119 typeErrorShowTypeDataConKey = mkPreludeDataConUnique 53
2120
2121 prefixIDataConKey, infixIDataConKey, leftAssociativeDataConKey,
2122 rightAssociativeDataConKey, notAssociativeDataConKey,
2123 sourceUnpackDataConKey, sourceNoUnpackDataConKey,
2124 noSourceUnpackednessDataConKey, sourceLazyDataConKey,
2125 sourceStrictDataConKey, noSourceStrictnessDataConKey,
2126 decidedLazyDataConKey, decidedStrictDataConKey, decidedUnpackDataConKey,
2127 metaDataDataConKey, metaConsDataConKey, metaSelDataConKey :: Unique
2128 prefixIDataConKey = mkPreludeDataConUnique 54
2129 infixIDataConKey = mkPreludeDataConUnique 55
2130 leftAssociativeDataConKey = mkPreludeDataConUnique 56
2131 rightAssociativeDataConKey = mkPreludeDataConUnique 57
2132 notAssociativeDataConKey = mkPreludeDataConUnique 58
2133 sourceUnpackDataConKey = mkPreludeDataConUnique 59
2134 sourceNoUnpackDataConKey = mkPreludeDataConUnique 60
2135 noSourceUnpackednessDataConKey = mkPreludeDataConUnique 61
2136 sourceLazyDataConKey = mkPreludeDataConUnique 62
2137 sourceStrictDataConKey = mkPreludeDataConUnique 63
2138 noSourceStrictnessDataConKey = mkPreludeDataConUnique 64
2139 decidedLazyDataConKey = mkPreludeDataConUnique 65
2140 decidedStrictDataConKey = mkPreludeDataConUnique 66
2141 decidedUnpackDataConKey = mkPreludeDataConUnique 67
2142 metaDataDataConKey = mkPreludeDataConUnique 68
2143 metaConsDataConKey = mkPreludeDataConUnique 69
2144 metaSelDataConKey = mkPreludeDataConUnique 70
2145
2146 vecRepDataConKey, tupleRepDataConKey, sumRepDataConKey,
2147 boxedRepDataConKey :: Unique
2148 vecRepDataConKey = mkPreludeDataConUnique 71
2149 tupleRepDataConKey = mkPreludeDataConUnique 72
2150 sumRepDataConKey = mkPreludeDataConUnique 73
2151 boxedRepDataConKey = mkPreludeDataConUnique 74
2152
2153 -- See Note [Wiring in RuntimeRep] in GHC.Builtin.Types
2154 -- Includes all nullary-data-constructor reps. Does not
2155 -- include BoxedRep, VecRep, SumRep, TupleRep.
2156 runtimeRepSimpleDataConKeys :: [Unique]
2157 runtimeRepSimpleDataConKeys
2158 = map mkPreludeDataConUnique [75..87]
2159
2160 liftedDataConKey,unliftedDataConKey :: Unique
2161 liftedDataConKey = mkPreludeDataConUnique 88
2162 unliftedDataConKey = mkPreludeDataConUnique 89
2163
2164 -- See Note [Wiring in RuntimeRep] in GHC.Builtin.Types
2165 -- VecCount
2166 vecCountDataConKeys :: [Unique]
2167 vecCountDataConKeys = map mkPreludeDataConUnique [90..95]
2168
2169 -- See Note [Wiring in RuntimeRep] in GHC.Builtin.Types
2170 -- VecElem
2171 vecElemDataConKeys :: [Unique]
2172 vecElemDataConKeys = map mkPreludeDataConUnique [96..105]
2173
2174 -- Typeable things
2175 kindRepTyConAppDataConKey, kindRepVarDataConKey, kindRepAppDataConKey,
2176 kindRepFunDataConKey, kindRepTYPEDataConKey,
2177 kindRepTypeLitSDataConKey, kindRepTypeLitDDataConKey
2178 :: Unique
2179 kindRepTyConAppDataConKey = mkPreludeDataConUnique 106
2180 kindRepVarDataConKey = mkPreludeDataConUnique 107
2181 kindRepAppDataConKey = mkPreludeDataConUnique 108
2182 kindRepFunDataConKey = mkPreludeDataConUnique 109
2183 kindRepTYPEDataConKey = mkPreludeDataConUnique 110
2184 kindRepTypeLitSDataConKey = mkPreludeDataConUnique 111
2185 kindRepTypeLitDDataConKey = mkPreludeDataConUnique 112
2186
2187 typeLitSymbolDataConKey, typeLitNatDataConKey, typeLitCharDataConKey :: Unique
2188 typeLitSymbolDataConKey = mkPreludeDataConUnique 113
2189 typeLitNatDataConKey = mkPreludeDataConUnique 114
2190 typeLitCharDataConKey = mkPreludeDataConUnique 115
2191
2192 -- Unsafe equality
2193 unsafeReflDataConKey :: Unique
2194 unsafeReflDataConKey = mkPreludeDataConUnique 116
2195
2196 -- Multiplicity
2197
2198 oneDataConKey, manyDataConKey :: Unique
2199 oneDataConKey = mkPreludeDataConUnique 117
2200 manyDataConKey = mkPreludeDataConUnique 118
2201
2202 -- ghc-bignum
2203 integerISDataConKey, integerINDataConKey, integerIPDataConKey,
2204 naturalNSDataConKey, naturalNBDataConKey :: Unique
2205 integerISDataConKey = mkPreludeDataConUnique 120
2206 integerINDataConKey = mkPreludeDataConUnique 121
2207 integerIPDataConKey = mkPreludeDataConUnique 122
2208 naturalNSDataConKey = mkPreludeDataConUnique 123
2209 naturalNBDataConKey = mkPreludeDataConUnique 124
2210
2211 ---------------- Template Haskell -------------------
2212 -- GHC.Builtin.Names.TH: USES DataUniques 200-250
2213 -----------------------------------------------------
2214
2215
2216 {-
2217 ************************************************************************
2218 * *
2219 \subsubsection[Uniques-prelude-Ids]{@Uniques@ for wired-in @Ids@ (except @DataCons@)}
2220 * *
2221 ************************************************************************
2222 -}
2223
2224 wildCardKey, absentErrorIdKey, augmentIdKey, appendIdKey,
2225 buildIdKey, foldrIdKey, recSelErrorIdKey,
2226 seqIdKey, eqStringIdKey,
2227 noMethodBindingErrorIdKey, nonExhaustiveGuardsErrorIdKey,
2228 runtimeErrorIdKey, patErrorIdKey, voidPrimIdKey,
2229 realWorldPrimIdKey, recConErrorIdKey,
2230 unpackCStringUtf8IdKey, unpackCStringAppendUtf8IdKey, unpackCStringFoldrUtf8IdKey,
2231 unpackCStringIdKey, unpackCStringAppendIdKey, unpackCStringFoldrIdKey,
2232 typeErrorIdKey, divIntIdKey, modIntIdKey,
2233 absentSumFieldErrorIdKey, cstringLengthIdKey,
2234 raiseOverflowIdKey, raiseUnderflowIdKey, raiseDivZeroIdKey
2235 :: Unique
2236
2237 wildCardKey = mkPreludeMiscIdUnique 0 -- See Note [WildCard binders]
2238 absentErrorIdKey = mkPreludeMiscIdUnique 1
2239 augmentIdKey = mkPreludeMiscIdUnique 2
2240 appendIdKey = mkPreludeMiscIdUnique 3
2241 buildIdKey = mkPreludeMiscIdUnique 4
2242 foldrIdKey = mkPreludeMiscIdUnique 6
2243 recSelErrorIdKey = mkPreludeMiscIdUnique 7
2244 seqIdKey = mkPreludeMiscIdUnique 8
2245 absentSumFieldErrorIdKey = mkPreludeMiscIdUnique 9
2246 eqStringIdKey = mkPreludeMiscIdUnique 10
2247 noMethodBindingErrorIdKey = mkPreludeMiscIdUnique 11
2248 nonExhaustiveGuardsErrorIdKey = mkPreludeMiscIdUnique 12
2249 runtimeErrorIdKey = mkPreludeMiscIdUnique 13
2250 patErrorIdKey = mkPreludeMiscIdUnique 14
2251 realWorldPrimIdKey = mkPreludeMiscIdUnique 15
2252 recConErrorIdKey = mkPreludeMiscIdUnique 16
2253
2254 unpackCStringUtf8IdKey = mkPreludeMiscIdUnique 17
2255 unpackCStringAppendUtf8IdKey = mkPreludeMiscIdUnique 18
2256 unpackCStringFoldrUtf8IdKey = mkPreludeMiscIdUnique 19
2257
2258 unpackCStringIdKey = mkPreludeMiscIdUnique 20
2259 unpackCStringAppendIdKey = mkPreludeMiscIdUnique 21
2260 unpackCStringFoldrIdKey = mkPreludeMiscIdUnique 22
2261
2262 voidPrimIdKey = mkPreludeMiscIdUnique 23
2263 typeErrorIdKey = mkPreludeMiscIdUnique 24
2264 divIntIdKey = mkPreludeMiscIdUnique 25
2265 modIntIdKey = mkPreludeMiscIdUnique 26
2266 cstringLengthIdKey = mkPreludeMiscIdUnique 27
2267 raiseOverflowIdKey = mkPreludeMiscIdUnique 28
2268 raiseUnderflowIdKey = mkPreludeMiscIdUnique 29
2269 raiseDivZeroIdKey = mkPreludeMiscIdUnique 30
2270
2271 concatIdKey, filterIdKey, zipIdKey,
2272 bindIOIdKey, returnIOIdKey, newStablePtrIdKey,
2273 printIdKey, failIOIdKey, nullAddrIdKey, voidArgIdKey,
2274 otherwiseIdKey, assertIdKey :: Unique
2275 concatIdKey = mkPreludeMiscIdUnique 31
2276 filterIdKey = mkPreludeMiscIdUnique 32
2277 zipIdKey = mkPreludeMiscIdUnique 33
2278 bindIOIdKey = mkPreludeMiscIdUnique 34
2279 returnIOIdKey = mkPreludeMiscIdUnique 35
2280 newStablePtrIdKey = mkPreludeMiscIdUnique 36
2281 printIdKey = mkPreludeMiscIdUnique 37
2282 failIOIdKey = mkPreludeMiscIdUnique 38
2283 nullAddrIdKey = mkPreludeMiscIdUnique 39
2284 voidArgIdKey = mkPreludeMiscIdUnique 40
2285 otherwiseIdKey = mkPreludeMiscIdUnique 43
2286 assertIdKey = mkPreludeMiscIdUnique 44
2287
2288 leftSectionKey, rightSectionKey :: Unique
2289 leftSectionKey = mkPreludeMiscIdUnique 45
2290 rightSectionKey = mkPreludeMiscIdUnique 46
2291
2292 rootMainKey, runMainKey :: Unique
2293 rootMainKey = mkPreludeMiscIdUnique 101
2294 runMainKey = mkPreludeMiscIdUnique 102
2295
2296 thenIOIdKey, lazyIdKey, assertErrorIdKey, oneShotKey, runRWKey :: Unique
2297 thenIOIdKey = mkPreludeMiscIdUnique 103
2298 lazyIdKey = mkPreludeMiscIdUnique 104
2299 assertErrorIdKey = mkPreludeMiscIdUnique 105
2300 oneShotKey = mkPreludeMiscIdUnique 106
2301 runRWKey = mkPreludeMiscIdUnique 107
2302
2303 traceKey :: Unique
2304 traceKey = mkPreludeMiscIdUnique 108
2305
2306 inlineIdKey, noinlineIdKey :: Unique
2307 inlineIdKey = mkPreludeMiscIdUnique 120
2308 -- see below
2309
2310 mapIdKey, groupWithIdKey, dollarIdKey, coercionTokenIdKey, considerAccessibleIdKey :: Unique
2311 mapIdKey = mkPreludeMiscIdUnique 121
2312 groupWithIdKey = mkPreludeMiscIdUnique 122
2313 dollarIdKey = mkPreludeMiscIdUnique 123
2314 coercionTokenIdKey = mkPreludeMiscIdUnique 124
2315 noinlineIdKey = mkPreludeMiscIdUnique 125
2316 considerAccessibleIdKey = mkPreludeMiscIdUnique 126
2317
2318 integerToFloatIdKey, integerToDoubleIdKey, naturalToFloatIdKey, naturalToDoubleIdKey :: Unique
2319 integerToFloatIdKey = mkPreludeMiscIdUnique 128
2320 integerToDoubleIdKey = mkPreludeMiscIdUnique 129
2321 naturalToFloatIdKey = mkPreludeMiscIdUnique 130
2322 naturalToDoubleIdKey = mkPreludeMiscIdUnique 131
2323
2324 rationalToFloatIdKey, rationalToDoubleIdKey :: Unique
2325 rationalToFloatIdKey = mkPreludeMiscIdUnique 132
2326 rationalToDoubleIdKey = mkPreludeMiscIdUnique 133
2327
2328 withDictKey :: Unique
2329 withDictKey = mkPreludeMiscIdUnique 156
2330
2331 coerceKey :: Unique
2332 coerceKey = mkPreludeMiscIdUnique 157
2333
2334 {-
2335 Certain class operations from Prelude classes. They get their own
2336 uniques so we can look them up easily when we want to conjure them up
2337 during type checking.
2338 -}
2339
2340 -- Just a placeholder for unbound variables produced by the renamer:
2341 unboundKey :: Unique
2342 unboundKey = mkPreludeMiscIdUnique 158
2343
2344 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey,
2345 enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey,
2346 enumFromThenToClassOpKey, eqClassOpKey, geClassOpKey, negateClassOpKey,
2347 bindMClassOpKey, thenMClassOpKey, returnMClassOpKey, fmapClassOpKey
2348 :: Unique
2349 fromIntegerClassOpKey = mkPreludeMiscIdUnique 160
2350 minusClassOpKey = mkPreludeMiscIdUnique 161
2351 fromRationalClassOpKey = mkPreludeMiscIdUnique 162
2352 enumFromClassOpKey = mkPreludeMiscIdUnique 163
2353 enumFromThenClassOpKey = mkPreludeMiscIdUnique 164
2354 enumFromToClassOpKey = mkPreludeMiscIdUnique 165
2355 enumFromThenToClassOpKey = mkPreludeMiscIdUnique 166
2356 eqClassOpKey = mkPreludeMiscIdUnique 167
2357 geClassOpKey = mkPreludeMiscIdUnique 168
2358 negateClassOpKey = mkPreludeMiscIdUnique 169
2359 bindMClassOpKey = mkPreludeMiscIdUnique 171 -- (>>=)
2360 thenMClassOpKey = mkPreludeMiscIdUnique 172 -- (>>)
2361 fmapClassOpKey = mkPreludeMiscIdUnique 173
2362 returnMClassOpKey = mkPreludeMiscIdUnique 174
2363
2364 -- Recursive do notation
2365 mfixIdKey :: Unique
2366 mfixIdKey = mkPreludeMiscIdUnique 175
2367
2368 -- MonadFail operations
2369 failMClassOpKey :: Unique
2370 failMClassOpKey = mkPreludeMiscIdUnique 176
2371
2372 -- fromLabel
2373 fromLabelClassOpKey :: Unique
2374 fromLabelClassOpKey = mkPreludeMiscIdUnique 177
2375
2376 -- Arrow notation
2377 arrAIdKey, composeAIdKey, firstAIdKey, appAIdKey, choiceAIdKey,
2378 loopAIdKey :: Unique
2379 arrAIdKey = mkPreludeMiscIdUnique 180
2380 composeAIdKey = mkPreludeMiscIdUnique 181 -- >>>
2381 firstAIdKey = mkPreludeMiscIdUnique 182
2382 appAIdKey = mkPreludeMiscIdUnique 183
2383 choiceAIdKey = mkPreludeMiscIdUnique 184 -- |||
2384 loopAIdKey = mkPreludeMiscIdUnique 185
2385
2386 fromStringClassOpKey :: Unique
2387 fromStringClassOpKey = mkPreludeMiscIdUnique 186
2388
2389 -- Annotation type checking
2390 toAnnotationWrapperIdKey :: Unique
2391 toAnnotationWrapperIdKey = mkPreludeMiscIdUnique 187
2392
2393 -- Conversion functions
2394 fromIntegralIdKey, realToFracIdKey, toIntegerClassOpKey, toRationalClassOpKey :: Unique
2395 fromIntegralIdKey = mkPreludeMiscIdUnique 190
2396 realToFracIdKey = mkPreludeMiscIdUnique 191
2397 toIntegerClassOpKey = mkPreludeMiscIdUnique 192
2398 toRationalClassOpKey = mkPreludeMiscIdUnique 193
2399
2400 -- Monad comprehensions
2401 guardMIdKey, liftMIdKey, mzipIdKey :: Unique
2402 guardMIdKey = mkPreludeMiscIdUnique 194
2403 liftMIdKey = mkPreludeMiscIdUnique 195
2404 mzipIdKey = mkPreludeMiscIdUnique 196
2405
2406 -- GHCi
2407 ghciStepIoMClassOpKey :: Unique
2408 ghciStepIoMClassOpKey = mkPreludeMiscIdUnique 197
2409
2410 -- Overloaded lists
2411 isListClassKey, fromListClassOpKey, fromListNClassOpKey, toListClassOpKey :: Unique
2412 isListClassKey = mkPreludeMiscIdUnique 198
2413 fromListClassOpKey = mkPreludeMiscIdUnique 199
2414 fromListNClassOpKey = mkPreludeMiscIdUnique 500
2415 toListClassOpKey = mkPreludeMiscIdUnique 501
2416
2417 proxyHashKey :: Unique
2418 proxyHashKey = mkPreludeMiscIdUnique 502
2419
2420 ---------------- Template Haskell -------------------
2421 -- GHC.Builtin.Names.TH: USES IdUniques 200-499
2422 -----------------------------------------------------
2423
2424 -- Used to make `Typeable` dictionaries
2425 mkTyConKey
2426 , mkTrTypeKey
2427 , mkTrConKey
2428 , mkTrAppKey
2429 , mkTrFunKey
2430 , typeNatTypeRepKey
2431 , typeSymbolTypeRepKey
2432 , typeCharTypeRepKey
2433 , typeRepIdKey
2434 :: Unique
2435 mkTyConKey = mkPreludeMiscIdUnique 503
2436 mkTrTypeKey = mkPreludeMiscIdUnique 504
2437 mkTrConKey = mkPreludeMiscIdUnique 505
2438 mkTrAppKey = mkPreludeMiscIdUnique 506
2439 typeNatTypeRepKey = mkPreludeMiscIdUnique 507
2440 typeSymbolTypeRepKey = mkPreludeMiscIdUnique 508
2441 typeCharTypeRepKey = mkPreludeMiscIdUnique 509
2442 typeRepIdKey = mkPreludeMiscIdUnique 510
2443 mkTrFunKey = mkPreludeMiscIdUnique 511
2444
2445 -- Representations for primitive types
2446 trTYPEKey
2447 , trTYPE'PtrRepLiftedKey
2448 , trRuntimeRepKey
2449 , tr'PtrRepLiftedKey
2450 , trLiftedRepKey
2451 :: Unique
2452 trTYPEKey = mkPreludeMiscIdUnique 512
2453 trTYPE'PtrRepLiftedKey = mkPreludeMiscIdUnique 513
2454 trRuntimeRepKey = mkPreludeMiscIdUnique 514
2455 tr'PtrRepLiftedKey = mkPreludeMiscIdUnique 515
2456 trLiftedRepKey = mkPreludeMiscIdUnique 516
2457
2458 -- KindReps for common cases
2459 starKindRepKey, starArrStarKindRepKey, starArrStarArrStarKindRepKey :: Unique
2460 starKindRepKey = mkPreludeMiscIdUnique 520
2461 starArrStarKindRepKey = mkPreludeMiscIdUnique 521
2462 starArrStarArrStarKindRepKey = mkPreludeMiscIdUnique 522
2463
2464 -- Dynamic
2465 toDynIdKey :: Unique
2466 toDynIdKey = mkPreludeMiscIdUnique 523
2467
2468
2469 bitIntegerIdKey :: Unique
2470 bitIntegerIdKey = mkPreludeMiscIdUnique 550
2471
2472 heqSCSelIdKey, eqSCSelIdKey, coercibleSCSelIdKey :: Unique
2473 eqSCSelIdKey = mkPreludeMiscIdUnique 551
2474 heqSCSelIdKey = mkPreludeMiscIdUnique 552
2475 coercibleSCSelIdKey = mkPreludeMiscIdUnique 553
2476
2477 sappendClassOpKey :: Unique
2478 sappendClassOpKey = mkPreludeMiscIdUnique 554
2479
2480 memptyClassOpKey, mappendClassOpKey, mconcatClassOpKey :: Unique
2481 memptyClassOpKey = mkPreludeMiscIdUnique 555
2482 mappendClassOpKey = mkPreludeMiscIdUnique 556
2483 mconcatClassOpKey = mkPreludeMiscIdUnique 557
2484
2485 emptyCallStackKey, pushCallStackKey :: Unique
2486 emptyCallStackKey = mkPreludeMiscIdUnique 558
2487 pushCallStackKey = mkPreludeMiscIdUnique 559
2488
2489 fromStaticPtrClassOpKey :: Unique
2490 fromStaticPtrClassOpKey = mkPreludeMiscIdUnique 560
2491
2492 makeStaticKey :: Unique
2493 makeStaticKey = mkPreludeMiscIdUnique 561
2494
2495 -- Unsafe coercion proofs
2496 unsafeEqualityProofIdKey, unsafeCoercePrimIdKey :: Unique
2497 unsafeEqualityProofIdKey = mkPreludeMiscIdUnique 570
2498 unsafeCoercePrimIdKey = mkPreludeMiscIdUnique 571
2499
2500 -- HasField class ops
2501 getFieldClassOpKey, setFieldClassOpKey :: Unique
2502 getFieldClassOpKey = mkPreludeMiscIdUnique 572
2503 setFieldClassOpKey = mkPreludeMiscIdUnique 573
2504
2505 ------------------------------------------------------
2506 -- ghc-bignum uses 600-699 uniques
2507 ------------------------------------------------------
2508
2509 integerFromNaturalIdKey
2510 , integerToNaturalClampIdKey
2511 , integerToNaturalThrowIdKey
2512 , integerToNaturalIdKey
2513 , integerToWordIdKey
2514 , integerToIntIdKey
2515 , integerToWord64IdKey
2516 , integerToInt64IdKey
2517 , integerAddIdKey
2518 , integerMulIdKey
2519 , integerSubIdKey
2520 , integerNegateIdKey
2521 , integerAbsIdKey
2522 , integerPopCountIdKey
2523 , integerQuotIdKey
2524 , integerRemIdKey
2525 , integerDivIdKey
2526 , integerModIdKey
2527 , integerDivModIdKey
2528 , integerQuotRemIdKey
2529 , integerEncodeFloatIdKey
2530 , integerEncodeDoubleIdKey
2531 , integerGcdIdKey
2532 , integerLcmIdKey
2533 , integerAndIdKey
2534 , integerOrIdKey
2535 , integerXorIdKey
2536 , integerComplementIdKey
2537 , integerBitIdKey
2538 , integerTestBitIdKey
2539 , integerShiftLIdKey
2540 , integerShiftRIdKey
2541 , integerFromWordIdKey
2542 , integerFromWord64IdKey
2543 , integerFromInt64IdKey
2544 , naturalToWordIdKey
2545 , naturalPopCountIdKey
2546 , naturalShiftRIdKey
2547 , naturalShiftLIdKey
2548 , naturalAddIdKey
2549 , naturalSubIdKey
2550 , naturalSubThrowIdKey
2551 , naturalSubUnsafeIdKey
2552 , naturalMulIdKey
2553 , naturalQuotRemIdKey
2554 , naturalQuotIdKey
2555 , naturalRemIdKey
2556 , naturalAndIdKey
2557 , naturalAndNotIdKey
2558 , naturalOrIdKey
2559 , naturalXorIdKey
2560 , naturalTestBitIdKey
2561 , naturalBitIdKey
2562 , naturalGcdIdKey
2563 , naturalLcmIdKey
2564 , naturalLog2IdKey
2565 , naturalLogBaseWordIdKey
2566 , naturalLogBaseIdKey
2567 , naturalPowModIdKey
2568 , naturalSizeInBaseIdKey
2569 , bignatFromWordListIdKey
2570 , bignatEqIdKey
2571 , bignatCompareIdKey
2572 , bignatCompareWordIdKey
2573 :: Unique
2574
2575 integerFromNaturalIdKey = mkPreludeMiscIdUnique 600
2576 integerToNaturalClampIdKey = mkPreludeMiscIdUnique 601
2577 integerToNaturalThrowIdKey = mkPreludeMiscIdUnique 602
2578 integerToNaturalIdKey = mkPreludeMiscIdUnique 603
2579 integerToWordIdKey = mkPreludeMiscIdUnique 604
2580 integerToIntIdKey = mkPreludeMiscIdUnique 605
2581 integerToWord64IdKey = mkPreludeMiscIdUnique 606
2582 integerToInt64IdKey = mkPreludeMiscIdUnique 607
2583 integerAddIdKey = mkPreludeMiscIdUnique 608
2584 integerMulIdKey = mkPreludeMiscIdUnique 609
2585 integerSubIdKey = mkPreludeMiscIdUnique 610
2586 integerNegateIdKey = mkPreludeMiscIdUnique 611
2587 integerAbsIdKey = mkPreludeMiscIdUnique 618
2588 integerPopCountIdKey = mkPreludeMiscIdUnique 621
2589 integerQuotIdKey = mkPreludeMiscIdUnique 622
2590 integerRemIdKey = mkPreludeMiscIdUnique 623
2591 integerDivIdKey = mkPreludeMiscIdUnique 624
2592 integerModIdKey = mkPreludeMiscIdUnique 625
2593 integerDivModIdKey = mkPreludeMiscIdUnique 626
2594 integerQuotRemIdKey = mkPreludeMiscIdUnique 627
2595 integerEncodeFloatIdKey = mkPreludeMiscIdUnique 630
2596 integerEncodeDoubleIdKey = mkPreludeMiscIdUnique 631
2597 integerGcdIdKey = mkPreludeMiscIdUnique 632
2598 integerLcmIdKey = mkPreludeMiscIdUnique 633
2599 integerAndIdKey = mkPreludeMiscIdUnique 634
2600 integerOrIdKey = mkPreludeMiscIdUnique 635
2601 integerXorIdKey = mkPreludeMiscIdUnique 636
2602 integerComplementIdKey = mkPreludeMiscIdUnique 637
2603 integerBitIdKey = mkPreludeMiscIdUnique 638
2604 integerTestBitIdKey = mkPreludeMiscIdUnique 639
2605 integerShiftLIdKey = mkPreludeMiscIdUnique 640
2606 integerShiftRIdKey = mkPreludeMiscIdUnique 641
2607 integerFromWordIdKey = mkPreludeMiscIdUnique 642
2608 integerFromWord64IdKey = mkPreludeMiscIdUnique 643
2609 integerFromInt64IdKey = mkPreludeMiscIdUnique 644
2610
2611 naturalToWordIdKey = mkPreludeMiscIdUnique 650
2612 naturalPopCountIdKey = mkPreludeMiscIdUnique 659
2613 naturalShiftRIdKey = mkPreludeMiscIdUnique 660
2614 naturalShiftLIdKey = mkPreludeMiscIdUnique 661
2615 naturalAddIdKey = mkPreludeMiscIdUnique 662
2616 naturalSubIdKey = mkPreludeMiscIdUnique 663
2617 naturalSubThrowIdKey = mkPreludeMiscIdUnique 664
2618 naturalSubUnsafeIdKey = mkPreludeMiscIdUnique 665
2619 naturalMulIdKey = mkPreludeMiscIdUnique 666
2620 naturalQuotRemIdKey = mkPreludeMiscIdUnique 669
2621 naturalQuotIdKey = mkPreludeMiscIdUnique 670
2622 naturalRemIdKey = mkPreludeMiscIdUnique 671
2623 naturalAndIdKey = mkPreludeMiscIdUnique 672
2624 naturalAndNotIdKey = mkPreludeMiscIdUnique 673
2625 naturalOrIdKey = mkPreludeMiscIdUnique 674
2626 naturalXorIdKey = mkPreludeMiscIdUnique 675
2627 naturalTestBitIdKey = mkPreludeMiscIdUnique 676
2628 naturalBitIdKey = mkPreludeMiscIdUnique 677
2629 naturalGcdIdKey = mkPreludeMiscIdUnique 678
2630 naturalLcmIdKey = mkPreludeMiscIdUnique 679
2631 naturalLog2IdKey = mkPreludeMiscIdUnique 680
2632 naturalLogBaseWordIdKey = mkPreludeMiscIdUnique 681
2633 naturalLogBaseIdKey = mkPreludeMiscIdUnique 682
2634 naturalPowModIdKey = mkPreludeMiscIdUnique 683
2635 naturalSizeInBaseIdKey = mkPreludeMiscIdUnique 684
2636
2637 bignatFromWordListIdKey = mkPreludeMiscIdUnique 690
2638 bignatEqIdKey = mkPreludeMiscIdUnique 691
2639 bignatCompareIdKey = mkPreludeMiscIdUnique 692
2640 bignatCompareWordIdKey = mkPreludeMiscIdUnique 693
2641
2642
2643 ------------------------------------------------------
2644 -- ghci optimization for big rationals 700-749 uniques
2645 ------------------------------------------------------
2646
2647 -- Creating rationals at runtime.
2648 mkRationalBase2IdKey, mkRationalBase10IdKey :: Unique
2649 mkRationalBase2IdKey = mkPreludeMiscIdUnique 700
2650 mkRationalBase10IdKey = mkPreludeMiscIdUnique 701 :: Unique
2651
2652 {-
2653 ************************************************************************
2654 * *
2655 \subsection[Class-std-groups]{Standard groups of Prelude classes}
2656 * *
2657 ************************************************************************
2658
2659 NOTE: @Eq@ and @Text@ do need to appear in @standardClasses@
2660 even though every numeric class has these two as a superclass,
2661 because the list of ambiguous dictionaries hasn't been simplified.
2662 -}
2663
2664 numericClassKeys :: [Unique]
2665 numericClassKeys =
2666 [ numClassKey
2667 , realClassKey
2668 , integralClassKey
2669 ]
2670 ++ fractionalClassKeys
2671
2672 fractionalClassKeys :: [Unique]
2673 fractionalClassKeys =
2674 [ fractionalClassKey
2675 , floatingClassKey
2676 , realFracClassKey
2677 , realFloatClassKey
2678 ]
2679
2680 -- The "standard classes" are used in defaulting (Haskell 98 report 4.3.4),
2681 -- and are: "classes defined in the Prelude or a standard library"
2682 standardClassKeys :: [Unique]
2683 standardClassKeys = derivableClassKeys ++ numericClassKeys
2684 ++ [randomClassKey, randomGenClassKey,
2685 functorClassKey,
2686 monadClassKey, monadPlusClassKey, monadFailClassKey,
2687 semigroupClassKey, monoidClassKey,
2688 isStringClassKey,
2689 applicativeClassKey, foldableClassKey,
2690 traversableClassKey, alternativeClassKey
2691 ]
2692
2693 {-
2694 @derivableClassKeys@ is also used in checking \tr{deriving} constructs
2695 (@GHC.Tc.Deriv@).
2696 -}
2697
2698 derivableClassKeys :: [Unique]
2699 derivableClassKeys
2700 = [ eqClassKey, ordClassKey, enumClassKey, ixClassKey,
2701 boundedClassKey, showClassKey, readClassKey ]
2702
2703
2704 -- These are the "interactive classes" that are consulted when doing
2705 -- defaulting. Does not include Num or IsString, which have special
2706 -- handling.
2707 interactiveClassNames :: [Name]
2708 interactiveClassNames
2709 = [ showClassName, eqClassName, ordClassName, foldableClassName
2710 , traversableClassName ]
2711
2712 interactiveClassKeys :: [Unique]
2713 interactiveClassKeys = map getUnique interactiveClassNames
2714
2715 {-
2716 ************************************************************************
2717 * *
2718 Semi-builtin names
2719 * *
2720 ************************************************************************
2721
2722 Note [pretendNameIsInScope]
2723 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2724 In general, we filter out instances that mention types whose names are
2725 not in scope. However, in the situations listed below, we make an exception
2726 for some commonly used names, such as Data.Kind.Type, which may not actually
2727 be in scope but should be treated as though they were in scope.
2728 This includes built-in names, as well as a few extra names such as
2729 'Type', 'TYPE', 'BoxedRep', etc.
2730
2731 Situations in which we apply this special logic:
2732
2733 - GHCi's :info command, see GHC.Runtime.Eval.getInfo.
2734 This fixes #1581.
2735
2736 - When reporting instance overlap errors. Not doing so could mean
2737 that we would omit instances for typeclasses like
2738
2739 type Cls :: k -> Constraint
2740 class Cls a
2741
2742 because BoxedRep/Lifted were not in scope.
2743 See GHC.Tc.Errors.pprPotentials.
2744 This fixes one of the issues reported in #20465.
2745 -}
2746
2747 -- | Should this name be considered in-scope, even though it technically isn't?
2748 --
2749 -- This ensures that we don't filter out information because, e.g.,
2750 -- Data.Kind.Type isn't imported.
2751 --
2752 -- See Note [pretendNameIsInScope].
2753 pretendNameIsInScope :: Name -> Bool
2754 pretendNameIsInScope n
2755 = isBuiltInSyntax n
2756 || any (n `hasKey`)
2757 [ liftedTypeKindTyConKey, unliftedTypeKindTyConKey
2758 , liftedDataConKey, unliftedDataConKey
2759 , tYPETyConKey
2760 , runtimeRepTyConKey, boxedRepDataConKey ]