Only pass mod_location with HscRecomp instead of the entire ModSummary
[ghc.git] / compiler / prelude / PrelNames.hs
1 {-
2 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
3
4 \section[PrelNames]{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 TysWiredIn) are used to initialise the "OrigNameCache" in
67 IfaceEnv. This initialization ensures that when the type checker
68 or renamer (both of which use IfaceEnv) 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 BinIface.putName, with that special treatment detected when we read back to
99 ensure that we get back to the correct uniques. See Note [Symbol table
100 representation of names] in BinIface and Note [How tuples work] in
101 TysWiredIn.
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) IfaceEnv.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
115 Note [The integer library]
116 ~~~~~~~~~~~~~~~~~~~~~~~~~~
117
118 Clearly, we need to know the names of various definitions of the integer
119 library, e.g. the type itself, `mkInteger` etc. But there are two possible
120 implementations of the integer library:
121
122 * integer-gmp (fast, but uses libgmp, which may not be available on all
123 targets and is GPL licensed)
124 * integer-simple (slow, but pure Haskell and BSD-licensed)
125
126 We want the compiler to work with either one. The way we achieve this is:
127
128 * When compiling the integer-{gmp,simple} library, we pass
129 -this-unit-id integer-wired-in
130 to GHC (see the cabal file libraries/integer-{gmp,simple}.
131 * This way, GHC can use just this UnitID (see Module.integerUnitId) when
132 generating code, and the linker will succeed.
133
134 Unfortuately, the abstraction is not complete: When using integer-gmp, we
135 really want to use the S# constructor directly. This is controlled by
136 the `integerLibrary` field of `DynFlags`: If it is IntegerGMP, we use
137 this constructor directly (see CorePrep.lookupIntegerSDataConName)
138
139 When GHC reads the package data base, it (internally only) pretends it has UnitId
140 `integer-wired-in` instead of the actual UnitId (which includes the version
141 number); just like for `base` and other packages, as described in
142 Note [Wired-in packages] in Module. This is done in Packages.findWiredInPackages.
143 -}
144
145 {-# LANGUAGE CPP #-}
146
147 module PrelNames (
148 Unique, Uniquable(..), hasKey, -- Re-exported for convenience
149
150 -----------------------------------------------------------
151 module PrelNames, -- A huge bunch of (a) Names, e.g. intTyConName
152 -- (b) Uniques e.g. intTyConKey
153 -- (c) Groups of classes and types
154 -- (d) miscellaneous things
155 -- So many that we export them all
156 ) where
157
158 #include "HsVersions.h"
159
160 import GhcPrelude
161
162 import Module
163 import OccName
164 import RdrName
165 import Unique
166 import Name
167 import SrcLoc
168 import FastString
169
170 {-
171 ************************************************************************
172 * *
173 allNameStrings
174 * *
175 ************************************************************************
176 -}
177
178 allNameStrings :: [String]
179 -- Infinite list of a,b,c...z, aa, ab, ac, ... etc
180 allNameStrings = [ c:cs | cs <- "" : allNameStrings, c <- ['a'..'z'] ]
181
182 {-
183 ************************************************************************
184 * *
185 \subsection{Local Names}
186 * *
187 ************************************************************************
188
189 This *local* name is used by the interactive stuff
190 -}
191
192 itName :: Unique -> SrcSpan -> Name
193 itName uniq loc = mkInternalName uniq (mkOccNameFS varName (fsLit "it")) loc
194
195 -- mkUnboundName makes a place-holder Name; it shouldn't be looked at except possibly
196 -- during compiler debugging.
197 mkUnboundName :: OccName -> Name
198 mkUnboundName occ = mkInternalName unboundKey occ noSrcSpan
199
200 isUnboundName :: Name -> Bool
201 isUnboundName name = name `hasKey` unboundKey
202
203 {-
204 ************************************************************************
205 * *
206 \subsection{Known key Names}
207 * *
208 ************************************************************************
209
210 This section tells what the compiler knows about the association of
211 names with uniques. These ones are the *non* wired-in ones. The
212 wired in ones are defined in TysWiredIn etc.
213 -}
214
215 basicKnownKeyNames :: [Name] -- See Note [Known-key names]
216 basicKnownKeyNames
217 = genericTyConNames
218 ++ [ -- Classes. *Must* include:
219 -- classes that are grabbed by key (e.g., eqClassKey)
220 -- classes in "Class.standardClassKeys" (quite a few)
221 eqClassName, -- mentioned, derivable
222 ordClassName, -- derivable
223 boundedClassName, -- derivable
224 numClassName, -- mentioned, numeric
225 enumClassName, -- derivable
226 monadClassName,
227 functorClassName,
228 realClassName, -- numeric
229 integralClassName, -- numeric
230 fractionalClassName, -- numeric
231 floatingClassName, -- numeric
232 realFracClassName, -- numeric
233 realFloatClassName, -- numeric
234 dataClassName,
235 isStringClassName,
236 applicativeClassName,
237 alternativeClassName,
238 foldableClassName,
239 traversableClassName,
240 semigroupClassName, sappendName,
241 monoidClassName, memptyName, mappendName, mconcatName,
242
243 -- The IO type
244 -- See Note [TyConRepNames for non-wired-in TyCons]
245 ioTyConName, ioDataConName,
246 runMainIOName,
247 runRWName,
248
249 -- Type representation types
250 trModuleTyConName, trModuleDataConName,
251 trNameTyConName, trNameSDataConName, trNameDDataConName,
252 trTyConTyConName, trTyConDataConName,
253
254 -- Typeable
255 typeableClassName,
256 typeRepTyConName,
257 someTypeRepTyConName,
258 someTypeRepDataConName,
259 kindRepTyConName,
260 kindRepTyConAppDataConName,
261 kindRepVarDataConName,
262 kindRepAppDataConName,
263 kindRepFunDataConName,
264 kindRepTYPEDataConName,
265 kindRepTypeLitSDataConName,
266 kindRepTypeLitDDataConName,
267 typeLitSortTyConName,
268 typeLitSymbolDataConName,
269 typeLitNatDataConName,
270 typeRepIdName,
271 mkTrTypeName,
272 mkTrConName,
273 mkTrAppName,
274 mkTrFunName,
275 typeSymbolTypeRepName, typeNatTypeRepName,
276 trGhcPrimModuleName,
277
278 -- KindReps for common cases
279 starKindRepName,
280 starArrStarKindRepName,
281 starArrStarArrStarKindRepName,
282
283 -- Dynamic
284 toDynName,
285
286 -- Numeric stuff
287 negateName, minusName, geName, eqName,
288
289 -- Conversion functions
290 rationalTyConName,
291 ratioTyConName, ratioDataConName,
292 fromRationalName, fromIntegerName,
293 toIntegerName, toRationalName,
294 fromIntegralName, realToFracName,
295
296 -- Int# stuff
297 divIntName, modIntName,
298
299 -- String stuff
300 fromStringName,
301
302 -- Enum stuff
303 enumFromName, enumFromThenName,
304 enumFromThenToName, enumFromToName,
305
306 -- Applicative stuff
307 pureAName, apAName, thenAName,
308
309 -- Functor stuff
310 fmapName,
311
312 -- Monad stuff
313 thenIOName, bindIOName, returnIOName, failIOName, bindMName, thenMName,
314 returnMName, joinMName,
315
316 -- MonadFail
317 monadFailClassName, failMName,
318
319 -- MonadFix
320 monadFixClassName, mfixName,
321
322 -- Arrow stuff
323 arrAName, composeAName, firstAName,
324 appAName, choiceAName, loopAName,
325
326 -- Ix stuff
327 ixClassName,
328
329 -- Show stuff
330 showClassName,
331
332 -- Read stuff
333 readClassName,
334
335 -- Stable pointers
336 newStablePtrName,
337
338 -- GHC Extensions
339 groupWithName,
340
341 -- Strings and lists
342 unpackCStringName,
343 unpackCStringFoldrName, unpackCStringUtf8Name,
344
345 -- Overloaded lists
346 isListClassName,
347 fromListName,
348 fromListNName,
349 toListName,
350
351 -- List operations
352 concatName, filterName, mapName,
353 zipName, foldrName, buildName, augmentName, appendName,
354
355 -- FFI primitive types that are not wired-in.
356 stablePtrTyConName, ptrTyConName, funPtrTyConName,
357 int8TyConName, int16TyConName, int32TyConName, int64TyConName,
358 word16TyConName, word32TyConName, word64TyConName,
359
360 -- Others
361 otherwiseIdName, inlineIdName,
362 eqStringName, assertName, breakpointName, breakpointCondName,
363 opaqueTyConName,
364 assertErrorName, traceName,
365 printName, fstName, sndName,
366 dollarName,
367
368 -- Integer
369 integerTyConName, mkIntegerName,
370 integerToWord64Name, integerToInt64Name,
371 word64ToIntegerName, int64ToIntegerName,
372 plusIntegerName, timesIntegerName, smallIntegerName,
373 wordToIntegerName,
374 integerToWordName, integerToIntName, minusIntegerName,
375 negateIntegerName, eqIntegerPrimName, neqIntegerPrimName,
376 absIntegerName, signumIntegerName,
377 leIntegerPrimName, gtIntegerPrimName, ltIntegerPrimName, geIntegerPrimName,
378 compareIntegerName, quotRemIntegerName, divModIntegerName,
379 quotIntegerName, remIntegerName, divIntegerName, modIntegerName,
380 floatFromIntegerName, doubleFromIntegerName,
381 encodeFloatIntegerName, encodeDoubleIntegerName,
382 decodeDoubleIntegerName,
383 gcdIntegerName, lcmIntegerName,
384 andIntegerName, orIntegerName, xorIntegerName, complementIntegerName,
385 shiftLIntegerName, shiftRIntegerName, bitIntegerName,
386 integerSDataConName,naturalSDataConName,
387
388 -- Natural
389 naturalTyConName,
390 naturalFromIntegerName, naturalToIntegerName,
391 plusNaturalName, minusNaturalName, timesNaturalName, mkNaturalName,
392 wordToNaturalName,
393
394 -- Float/Double
395 rationalToFloatName,
396 rationalToDoubleName,
397
398 -- Other classes
399 randomClassName, randomGenClassName, monadPlusClassName,
400
401 -- Type-level naturals
402 knownNatClassName, knownSymbolClassName,
403
404 -- Overloaded labels
405 isLabelClassName,
406
407 -- Implicit Parameters
408 ipClassName,
409
410 -- Overloaded record fields
411 hasFieldClassName,
412
413 -- Call Stacks
414 callStackTyConName,
415 emptyCallStackName, pushCallStackName,
416
417 -- Source Locations
418 srcLocDataConName,
419
420 -- Annotation type checking
421 toAnnotationWrapperName
422
423 -- The Ordering type
424 , orderingTyConName
425 , ordLTDataConName, ordEQDataConName, ordGTDataConName
426
427 -- The SPEC type for SpecConstr
428 , specTyConName
429
430 -- The Either type
431 , eitherTyConName, leftDataConName, rightDataConName
432
433 -- Plugins
434 , pluginTyConName
435 , frontendPluginTyConName
436
437 -- Generics
438 , genClassName, gen1ClassName
439 , datatypeClassName, constructorClassName, selectorClassName
440
441 -- Monad comprehensions
442 , guardMName
443 , liftMName
444 , mzipName
445
446 -- GHCi Sandbox
447 , ghciIoClassName, ghciStepIoMName
448
449 -- StaticPtr
450 , makeStaticName
451 , staticPtrTyConName
452 , staticPtrDataConName, staticPtrInfoDataConName
453 , fromStaticPtrName
454
455 -- Fingerprint
456 , fingerprintDataConName
457
458 -- Custom type errors
459 , errorMessageTypeErrorFamName
460 , typeErrorTextDataConName
461 , typeErrorAppendDataConName
462 , typeErrorVAppendDataConName
463 , typeErrorShowTypeDataConName
464
465 ]
466
467 genericTyConNames :: [Name]
468 genericTyConNames = [
469 v1TyConName, u1TyConName, par1TyConName, rec1TyConName,
470 k1TyConName, m1TyConName, sumTyConName, prodTyConName,
471 compTyConName, rTyConName, dTyConName,
472 cTyConName, sTyConName, rec0TyConName,
473 d1TyConName, c1TyConName, s1TyConName, noSelTyConName,
474 repTyConName, rep1TyConName, uRecTyConName,
475 uAddrTyConName, uCharTyConName, uDoubleTyConName,
476 uFloatTyConName, uIntTyConName, uWordTyConName,
477 prefixIDataConName, infixIDataConName, leftAssociativeDataConName,
478 rightAssociativeDataConName, notAssociativeDataConName,
479 sourceUnpackDataConName, sourceNoUnpackDataConName,
480 noSourceUnpackednessDataConName, sourceLazyDataConName,
481 sourceStrictDataConName, noSourceStrictnessDataConName,
482 decidedLazyDataConName, decidedStrictDataConName, decidedUnpackDataConName,
483 metaDataDataConName, metaConsDataConName, metaSelDataConName
484 ]
485
486 {-
487 ************************************************************************
488 * *
489 \subsection{Module names}
490 * *
491 ************************************************************************
492
493
494 --MetaHaskell Extension Add a new module here
495 -}
496
497 pRELUDE :: Module
498 pRELUDE = mkBaseModule_ pRELUDE_NAME
499
500 gHC_PRIM, gHC_TYPES, gHC_GENERICS, gHC_MAGIC,
501 gHC_CLASSES, gHC_PRIMOPWRAPPERS, gHC_BASE, gHC_ENUM,
502 gHC_GHCI, gHC_GHCI_HELPERS, gHC_CSTRING,
503 gHC_SHOW, gHC_READ, gHC_NUM, gHC_MAYBE, gHC_INTEGER_TYPE, gHC_NATURAL,
504 gHC_LIST, gHC_TUPLE, dATA_TUPLE, dATA_EITHER, dATA_STRING,
505 dATA_FOLDABLE, dATA_TRAVERSABLE,
506 gHC_CONC, gHC_IO, gHC_IO_Exception,
507 gHC_ST, gHC_IX, gHC_STABLE, gHC_PTR, gHC_ERR, gHC_REAL,
508 gHC_FLOAT, gHC_TOP_HANDLER, sYSTEM_IO, dYNAMIC,
509 tYPEABLE, tYPEABLE_INTERNAL, gENERICS,
510 rEAD_PREC, lEX, gHC_INT, gHC_WORD, mONAD, mONAD_FIX, mONAD_ZIP, mONAD_FAIL,
511 aRROW, cONTROL_APPLICATIVE, gHC_DESUGAR, rANDOM, gHC_EXTS,
512 cONTROL_EXCEPTION_BASE, gHC_TYPELITS, gHC_TYPENATS, dATA_TYPE_EQUALITY,
513 dATA_COERCE, dEBUG_TRACE :: Module
514
515 gHC_PRIM = mkPrimModule (fsLit "GHC.Prim") -- Primitive types and values
516 gHC_TYPES = mkPrimModule (fsLit "GHC.Types")
517 gHC_MAGIC = mkPrimModule (fsLit "GHC.Magic")
518 gHC_CSTRING = mkPrimModule (fsLit "GHC.CString")
519 gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes")
520 gHC_PRIMOPWRAPPERS = mkPrimModule (fsLit "GHC.PrimopWrappers")
521
522 gHC_BASE = mkBaseModule (fsLit "GHC.Base")
523 gHC_ENUM = mkBaseModule (fsLit "GHC.Enum")
524 gHC_GHCI = mkBaseModule (fsLit "GHC.GHCi")
525 gHC_GHCI_HELPERS= mkBaseModule (fsLit "GHC.GHCi.Helpers")
526 gHC_SHOW = mkBaseModule (fsLit "GHC.Show")
527 gHC_READ = mkBaseModule (fsLit "GHC.Read")
528 gHC_NUM = mkBaseModule (fsLit "GHC.Num")
529 gHC_MAYBE = mkBaseModule (fsLit "GHC.Maybe")
530 gHC_INTEGER_TYPE= mkIntegerModule (fsLit "GHC.Integer.Type")
531 gHC_NATURAL = mkBaseModule (fsLit "GHC.Natural")
532 gHC_LIST = mkBaseModule (fsLit "GHC.List")
533 gHC_TUPLE = mkPrimModule (fsLit "GHC.Tuple")
534 dATA_TUPLE = mkBaseModule (fsLit "Data.Tuple")
535 dATA_EITHER = mkBaseModule (fsLit "Data.Either")
536 dATA_STRING = mkBaseModule (fsLit "Data.String")
537 dATA_FOLDABLE = mkBaseModule (fsLit "Data.Foldable")
538 dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable")
539 gHC_CONC = mkBaseModule (fsLit "GHC.Conc")
540 gHC_IO = mkBaseModule (fsLit "GHC.IO")
541 gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
542 gHC_ST = mkBaseModule (fsLit "GHC.ST")
543 gHC_IX = mkBaseModule (fsLit "GHC.Ix")
544 gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
545 gHC_PTR = mkBaseModule (fsLit "GHC.Ptr")
546 gHC_ERR = mkBaseModule (fsLit "GHC.Err")
547 gHC_REAL = mkBaseModule (fsLit "GHC.Real")
548 gHC_FLOAT = mkBaseModule (fsLit "GHC.Float")
549 gHC_TOP_HANDLER = mkBaseModule (fsLit "GHC.TopHandler")
550 sYSTEM_IO = mkBaseModule (fsLit "System.IO")
551 dYNAMIC = mkBaseModule (fsLit "Data.Dynamic")
552 tYPEABLE = mkBaseModule (fsLit "Data.Typeable")
553 tYPEABLE_INTERNAL = mkBaseModule (fsLit "Data.Typeable.Internal")
554 gENERICS = mkBaseModule (fsLit "Data.Data")
555 rEAD_PREC = mkBaseModule (fsLit "Text.ParserCombinators.ReadPrec")
556 lEX = mkBaseModule (fsLit "Text.Read.Lex")
557 gHC_INT = mkBaseModule (fsLit "GHC.Int")
558 gHC_WORD = mkBaseModule (fsLit "GHC.Word")
559 mONAD = mkBaseModule (fsLit "Control.Monad")
560 mONAD_FIX = mkBaseModule (fsLit "Control.Monad.Fix")
561 mONAD_ZIP = mkBaseModule (fsLit "Control.Monad.Zip")
562 mONAD_FAIL = mkBaseModule (fsLit "Control.Monad.Fail")
563 aRROW = mkBaseModule (fsLit "Control.Arrow")
564 cONTROL_APPLICATIVE = mkBaseModule (fsLit "Control.Applicative")
565 gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
566 rANDOM = mkBaseModule (fsLit "System.Random")
567 gHC_EXTS = mkBaseModule (fsLit "GHC.Exts")
568 cONTROL_EXCEPTION_BASE = mkBaseModule (fsLit "Control.Exception.Base")
569 gHC_GENERICS = mkBaseModule (fsLit "GHC.Generics")
570 gHC_TYPELITS = mkBaseModule (fsLit "GHC.TypeLits")
571 gHC_TYPENATS = mkBaseModule (fsLit "GHC.TypeNats")
572 dATA_TYPE_EQUALITY = mkBaseModule (fsLit "Data.Type.Equality")
573 dATA_COERCE = mkBaseModule (fsLit "Data.Coerce")
574 dEBUG_TRACE = mkBaseModule (fsLit "Debug.Trace")
575
576 gHC_SRCLOC :: Module
577 gHC_SRCLOC = mkBaseModule (fsLit "GHC.SrcLoc")
578
579 gHC_STACK, gHC_STACK_TYPES :: Module
580 gHC_STACK = mkBaseModule (fsLit "GHC.Stack")
581 gHC_STACK_TYPES = mkBaseModule (fsLit "GHC.Stack.Types")
582
583 gHC_STATICPTR :: Module
584 gHC_STATICPTR = mkBaseModule (fsLit "GHC.StaticPtr")
585
586 gHC_STATICPTR_INTERNAL :: Module
587 gHC_STATICPTR_INTERNAL = mkBaseModule (fsLit "GHC.StaticPtr.Internal")
588
589 gHC_FINGERPRINT_TYPE :: Module
590 gHC_FINGERPRINT_TYPE = mkBaseModule (fsLit "GHC.Fingerprint.Type")
591
592 gHC_OVER_LABELS :: Module
593 gHC_OVER_LABELS = mkBaseModule (fsLit "GHC.OverloadedLabels")
594
595 gHC_RECORDS :: Module
596 gHC_RECORDS = mkBaseModule (fsLit "GHC.Records")
597
598 mAIN, rOOT_MAIN :: Module
599 mAIN = mkMainModule_ mAIN_NAME
600 rOOT_MAIN = mkMainModule (fsLit ":Main") -- Root module for initialisation
601
602 mkInteractiveModule :: Int -> Module
603 -- (mkInteractiveMoudule 9) makes module 'interactive:M9'
604 mkInteractiveModule n = mkModule interactiveUnitId (mkModuleName ("Ghci" ++ show n))
605
606 pRELUDE_NAME, mAIN_NAME :: ModuleName
607 pRELUDE_NAME = mkModuleNameFS (fsLit "Prelude")
608 mAIN_NAME = mkModuleNameFS (fsLit "Main")
609
610 dATA_ARRAY_PARALLEL_NAME, dATA_ARRAY_PARALLEL_PRIM_NAME :: ModuleName
611 dATA_ARRAY_PARALLEL_NAME = mkModuleNameFS (fsLit "Data.Array.Parallel")
612 dATA_ARRAY_PARALLEL_PRIM_NAME = mkModuleNameFS (fsLit "Data.Array.Parallel.Prim")
613
614 mkPrimModule :: FastString -> Module
615 mkPrimModule m = mkModule primUnitId (mkModuleNameFS m)
616
617 mkIntegerModule :: FastString -> Module
618 mkIntegerModule m = mkModule integerUnitId (mkModuleNameFS m)
619
620 mkBaseModule :: FastString -> Module
621 mkBaseModule m = mkModule baseUnitId (mkModuleNameFS m)
622
623 mkBaseModule_ :: ModuleName -> Module
624 mkBaseModule_ m = mkModule baseUnitId m
625
626 mkThisGhcModule :: FastString -> Module
627 mkThisGhcModule m = mkModule thisGhcUnitId (mkModuleNameFS m)
628
629 mkThisGhcModule_ :: ModuleName -> Module
630 mkThisGhcModule_ m = mkModule thisGhcUnitId m
631
632 mkMainModule :: FastString -> Module
633 mkMainModule m = mkModule mainUnitId (mkModuleNameFS m)
634
635 mkMainModule_ :: ModuleName -> Module
636 mkMainModule_ m = mkModule mainUnitId m
637
638 {-
639 ************************************************************************
640 * *
641 RdrNames
642 * *
643 ************************************************************************
644 -}
645
646 main_RDR_Unqual :: RdrName
647 main_RDR_Unqual = mkUnqual varName (fsLit "main")
648 -- We definitely don't want an Orig RdrName, because
649 -- main might, in principle, be imported into module Main
650
651 eq_RDR, ge_RDR, le_RDR, lt_RDR, gt_RDR, compare_RDR,
652 ltTag_RDR, eqTag_RDR, gtTag_RDR :: RdrName
653 eq_RDR = nameRdrName eqName
654 ge_RDR = nameRdrName geName
655 le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=")
656 lt_RDR = varQual_RDR gHC_CLASSES (fsLit "<")
657 gt_RDR = varQual_RDR gHC_CLASSES (fsLit ">")
658 compare_RDR = varQual_RDR gHC_CLASSES (fsLit "compare")
659 ltTag_RDR = nameRdrName ordLTDataConName
660 eqTag_RDR = nameRdrName ordEQDataConName
661 gtTag_RDR = nameRdrName ordGTDataConName
662
663 eqClass_RDR, numClass_RDR, ordClass_RDR, enumClass_RDR, monadClass_RDR
664 :: RdrName
665 eqClass_RDR = nameRdrName eqClassName
666 numClass_RDR = nameRdrName numClassName
667 ordClass_RDR = nameRdrName ordClassName
668 enumClass_RDR = nameRdrName enumClassName
669 monadClass_RDR = nameRdrName monadClassName
670
671 map_RDR, append_RDR :: RdrName
672 map_RDR = nameRdrName mapName
673 append_RDR = nameRdrName appendName
674
675 foldr_RDR, build_RDR, returnM_RDR, bindM_RDR, failM_RDR
676 :: RdrName
677 foldr_RDR = nameRdrName foldrName
678 build_RDR = nameRdrName buildName
679 returnM_RDR = nameRdrName returnMName
680 bindM_RDR = nameRdrName bindMName
681 failM_RDR = nameRdrName failMName
682
683 left_RDR, right_RDR :: RdrName
684 left_RDR = nameRdrName leftDataConName
685 right_RDR = nameRdrName rightDataConName
686
687 fromEnum_RDR, toEnum_RDR :: RdrName
688 fromEnum_RDR = varQual_RDR gHC_ENUM (fsLit "fromEnum")
689 toEnum_RDR = varQual_RDR gHC_ENUM (fsLit "toEnum")
690
691 enumFrom_RDR, enumFromTo_RDR, enumFromThen_RDR, enumFromThenTo_RDR :: RdrName
692 enumFrom_RDR = nameRdrName enumFromName
693 enumFromTo_RDR = nameRdrName enumFromToName
694 enumFromThen_RDR = nameRdrName enumFromThenName
695 enumFromThenTo_RDR = nameRdrName enumFromThenToName
696
697 ratioDataCon_RDR, plusInteger_RDR, timesInteger_RDR :: RdrName
698 ratioDataCon_RDR = nameRdrName ratioDataConName
699 plusInteger_RDR = nameRdrName plusIntegerName
700 timesInteger_RDR = nameRdrName timesIntegerName
701
702 ioDataCon_RDR :: RdrName
703 ioDataCon_RDR = nameRdrName ioDataConName
704
705 eqString_RDR, unpackCString_RDR, unpackCStringFoldr_RDR,
706 unpackCStringUtf8_RDR :: RdrName
707 eqString_RDR = nameRdrName eqStringName
708 unpackCString_RDR = nameRdrName unpackCStringName
709 unpackCStringFoldr_RDR = nameRdrName unpackCStringFoldrName
710 unpackCStringUtf8_RDR = nameRdrName unpackCStringUtf8Name
711
712 newStablePtr_RDR :: RdrName
713 newStablePtr_RDR = nameRdrName newStablePtrName
714
715 bindIO_RDR, returnIO_RDR :: RdrName
716 bindIO_RDR = nameRdrName bindIOName
717 returnIO_RDR = nameRdrName returnIOName
718
719 fromInteger_RDR, fromRational_RDR, minus_RDR, times_RDR, plus_RDR :: RdrName
720 fromInteger_RDR = nameRdrName fromIntegerName
721 fromRational_RDR = nameRdrName fromRationalName
722 minus_RDR = nameRdrName minusName
723 times_RDR = varQual_RDR gHC_NUM (fsLit "*")
724 plus_RDR = varQual_RDR gHC_NUM (fsLit "+")
725
726 toInteger_RDR, toRational_RDR, fromIntegral_RDR :: RdrName
727 toInteger_RDR = nameRdrName toIntegerName
728 toRational_RDR = nameRdrName toRationalName
729 fromIntegral_RDR = nameRdrName fromIntegralName
730
731 stringTy_RDR, fromString_RDR :: RdrName
732 stringTy_RDR = tcQual_RDR gHC_BASE (fsLit "String")
733 fromString_RDR = nameRdrName fromStringName
734
735 fromList_RDR, fromListN_RDR, toList_RDR :: RdrName
736 fromList_RDR = nameRdrName fromListName
737 fromListN_RDR = nameRdrName fromListNName
738 toList_RDR = nameRdrName toListName
739
740 compose_RDR :: RdrName
741 compose_RDR = varQual_RDR gHC_BASE (fsLit ".")
742
743 not_RDR, getTag_RDR, succ_RDR, pred_RDR, minBound_RDR, maxBound_RDR,
744 and_RDR, range_RDR, inRange_RDR, index_RDR,
745 unsafeIndex_RDR, unsafeRangeSize_RDR :: RdrName
746 and_RDR = varQual_RDR gHC_CLASSES (fsLit "&&")
747 not_RDR = varQual_RDR gHC_CLASSES (fsLit "not")
748 getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag")
749 succ_RDR = varQual_RDR gHC_ENUM (fsLit "succ")
750 pred_RDR = varQual_RDR gHC_ENUM (fsLit "pred")
751 minBound_RDR = varQual_RDR gHC_ENUM (fsLit "minBound")
752 maxBound_RDR = varQual_RDR gHC_ENUM (fsLit "maxBound")
753 range_RDR = varQual_RDR gHC_IX (fsLit "range")
754 inRange_RDR = varQual_RDR gHC_IX (fsLit "inRange")
755 index_RDR = varQual_RDR gHC_IX (fsLit "index")
756 unsafeIndex_RDR = varQual_RDR gHC_IX (fsLit "unsafeIndex")
757 unsafeRangeSize_RDR = varQual_RDR gHC_IX (fsLit "unsafeRangeSize")
758
759 readList_RDR, readListDefault_RDR, readListPrec_RDR, readListPrecDefault_RDR,
760 readPrec_RDR, parens_RDR, choose_RDR, lexP_RDR, expectP_RDR :: RdrName
761 readList_RDR = varQual_RDR gHC_READ (fsLit "readList")
762 readListDefault_RDR = varQual_RDR gHC_READ (fsLit "readListDefault")
763 readListPrec_RDR = varQual_RDR gHC_READ (fsLit "readListPrec")
764 readListPrecDefault_RDR = varQual_RDR gHC_READ (fsLit "readListPrecDefault")
765 readPrec_RDR = varQual_RDR gHC_READ (fsLit "readPrec")
766 parens_RDR = varQual_RDR gHC_READ (fsLit "parens")
767 choose_RDR = varQual_RDR gHC_READ (fsLit "choose")
768 lexP_RDR = varQual_RDR gHC_READ (fsLit "lexP")
769 expectP_RDR = varQual_RDR gHC_READ (fsLit "expectP")
770
771 readField_RDR, readFieldHash_RDR, readSymField_RDR :: RdrName
772 readField_RDR = varQual_RDR gHC_READ (fsLit "readField")
773 readFieldHash_RDR = varQual_RDR gHC_READ (fsLit "readFieldHash")
774 readSymField_RDR = varQual_RDR gHC_READ (fsLit "readSymField")
775
776 punc_RDR, ident_RDR, symbol_RDR :: RdrName
777 punc_RDR = dataQual_RDR lEX (fsLit "Punc")
778 ident_RDR = dataQual_RDR lEX (fsLit "Ident")
779 symbol_RDR = dataQual_RDR lEX (fsLit "Symbol")
780
781 step_RDR, alt_RDR, reset_RDR, prec_RDR, pfail_RDR :: RdrName
782 step_RDR = varQual_RDR rEAD_PREC (fsLit "step")
783 alt_RDR = varQual_RDR rEAD_PREC (fsLit "+++")
784 reset_RDR = varQual_RDR rEAD_PREC (fsLit "reset")
785 prec_RDR = varQual_RDR rEAD_PREC (fsLit "prec")
786 pfail_RDR = varQual_RDR rEAD_PREC (fsLit "pfail")
787
788 showsPrec_RDR, shows_RDR, showString_RDR,
789 showSpace_RDR, showCommaSpace_RDR, showParen_RDR :: RdrName
790 showsPrec_RDR = varQual_RDR gHC_SHOW (fsLit "showsPrec")
791 shows_RDR = varQual_RDR gHC_SHOW (fsLit "shows")
792 showString_RDR = varQual_RDR gHC_SHOW (fsLit "showString")
793 showSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showSpace")
794 showCommaSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showCommaSpace")
795 showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen")
796
797 undefined_RDR :: RdrName
798 undefined_RDR = varQual_RDR gHC_ERR (fsLit "undefined")
799
800 error_RDR :: RdrName
801 error_RDR = varQual_RDR gHC_ERR (fsLit "error")
802
803 -- Generics (constructors and functions)
804 u1DataCon_RDR, par1DataCon_RDR, rec1DataCon_RDR,
805 k1DataCon_RDR, m1DataCon_RDR, l1DataCon_RDR, r1DataCon_RDR,
806 prodDataCon_RDR, comp1DataCon_RDR,
807 unPar1_RDR, unRec1_RDR, unK1_RDR, unComp1_RDR,
808 from_RDR, from1_RDR, to_RDR, to1_RDR,
809 datatypeName_RDR, moduleName_RDR, packageName_RDR, isNewtypeName_RDR,
810 conName_RDR, conFixity_RDR, conIsRecord_RDR, selName_RDR,
811 prefixDataCon_RDR, infixDataCon_RDR, leftAssocDataCon_RDR,
812 rightAssocDataCon_RDR, notAssocDataCon_RDR,
813 uAddrDataCon_RDR, uCharDataCon_RDR, uDoubleDataCon_RDR,
814 uFloatDataCon_RDR, uIntDataCon_RDR, uWordDataCon_RDR,
815 uAddrHash_RDR, uCharHash_RDR, uDoubleHash_RDR,
816 uFloatHash_RDR, uIntHash_RDR, uWordHash_RDR :: RdrName
817
818 u1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "U1")
819 par1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Par1")
820 rec1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Rec1")
821 k1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "K1")
822 m1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "M1")
823
824 l1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "L1")
825 r1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "R1")
826
827 prodDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit ":*:")
828 comp1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Comp1")
829
830 unPar1_RDR = varQual_RDR gHC_GENERICS (fsLit "unPar1")
831 unRec1_RDR = varQual_RDR gHC_GENERICS (fsLit "unRec1")
832 unK1_RDR = varQual_RDR gHC_GENERICS (fsLit "unK1")
833 unComp1_RDR = varQual_RDR gHC_GENERICS (fsLit "unComp1")
834
835 from_RDR = varQual_RDR gHC_GENERICS (fsLit "from")
836 from1_RDR = varQual_RDR gHC_GENERICS (fsLit "from1")
837 to_RDR = varQual_RDR gHC_GENERICS (fsLit "to")
838 to1_RDR = varQual_RDR gHC_GENERICS (fsLit "to1")
839
840 datatypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "datatypeName")
841 moduleName_RDR = varQual_RDR gHC_GENERICS (fsLit "moduleName")
842 packageName_RDR = varQual_RDR gHC_GENERICS (fsLit "packageName")
843 isNewtypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "isNewtype")
844 selName_RDR = varQual_RDR gHC_GENERICS (fsLit "selName")
845 conName_RDR = varQual_RDR gHC_GENERICS (fsLit "conName")
846 conFixity_RDR = varQual_RDR gHC_GENERICS (fsLit "conFixity")
847 conIsRecord_RDR = varQual_RDR gHC_GENERICS (fsLit "conIsRecord")
848
849 prefixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Prefix")
850 infixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Infix")
851 leftAssocDataCon_RDR = nameRdrName leftAssociativeDataConName
852 rightAssocDataCon_RDR = nameRdrName rightAssociativeDataConName
853 notAssocDataCon_RDR = nameRdrName notAssociativeDataConName
854
855 uAddrDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UAddr")
856 uCharDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UChar")
857 uDoubleDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UDouble")
858 uFloatDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UFloat")
859 uIntDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UInt")
860 uWordDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UWord")
861
862 uAddrHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uAddr#")
863 uCharHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uChar#")
864 uDoubleHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uDouble#")
865 uFloatHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uFloat#")
866 uIntHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uInt#")
867 uWordHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uWord#")
868
869 fmap_RDR, replace_RDR, pure_RDR, ap_RDR, liftA2_RDR, foldable_foldr_RDR,
870 foldMap_RDR, null_RDR, all_RDR, traverse_RDR, mempty_RDR,
871 mappend_RDR :: RdrName
872 fmap_RDR = nameRdrName fmapName
873 replace_RDR = varQual_RDR gHC_BASE (fsLit "<$")
874 pure_RDR = nameRdrName pureAName
875 ap_RDR = nameRdrName apAName
876 liftA2_RDR = varQual_RDR gHC_BASE (fsLit "liftA2")
877 foldable_foldr_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldr")
878 foldMap_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldMap")
879 null_RDR = varQual_RDR dATA_FOLDABLE (fsLit "null")
880 all_RDR = varQual_RDR dATA_FOLDABLE (fsLit "all")
881 traverse_RDR = varQual_RDR dATA_TRAVERSABLE (fsLit "traverse")
882 mempty_RDR = nameRdrName memptyName
883 mappend_RDR = nameRdrName mappendName
884
885 ----------------------
886 varQual_RDR, tcQual_RDR, clsQual_RDR, dataQual_RDR
887 :: Module -> FastString -> RdrName
888 varQual_RDR mod str = mkOrig mod (mkOccNameFS varName str)
889 tcQual_RDR mod str = mkOrig mod (mkOccNameFS tcName str)
890 clsQual_RDR mod str = mkOrig mod (mkOccNameFS clsName str)
891 dataQual_RDR mod str = mkOrig mod (mkOccNameFS dataName str)
892
893 {-
894 ************************************************************************
895 * *
896 \subsection{Known-key names}
897 * *
898 ************************************************************************
899
900 Many of these Names are not really "built in", but some parts of the
901 compiler (notably the deriving mechanism) need to mention their names,
902 and it's convenient to write them all down in one place.
903 -}
904
905 wildCardName :: Name
906 wildCardName = mkSystemVarName wildCardKey (fsLit "wild")
907
908 runMainIOName, runRWName :: Name
909 runMainIOName = varQual gHC_TOP_HANDLER (fsLit "runMainIO") runMainKey
910 runRWName = varQual gHC_MAGIC (fsLit "runRW#") runRWKey
911
912 orderingTyConName, ordLTDataConName, ordEQDataConName, ordGTDataConName :: Name
913 orderingTyConName = tcQual gHC_TYPES (fsLit "Ordering") orderingTyConKey
914 ordLTDataConName = dcQual gHC_TYPES (fsLit "LT") ordLTDataConKey
915 ordEQDataConName = dcQual gHC_TYPES (fsLit "EQ") ordEQDataConKey
916 ordGTDataConName = dcQual gHC_TYPES (fsLit "GT") ordGTDataConKey
917
918 specTyConName :: Name
919 specTyConName = tcQual gHC_TYPES (fsLit "SPEC") specTyConKey
920
921 eitherTyConName, leftDataConName, rightDataConName :: Name
922 eitherTyConName = tcQual dATA_EITHER (fsLit "Either") eitherTyConKey
923 leftDataConName = dcQual dATA_EITHER (fsLit "Left") leftDataConKey
924 rightDataConName = dcQual dATA_EITHER (fsLit "Right") rightDataConKey
925
926 -- Generics (types)
927 v1TyConName, u1TyConName, par1TyConName, rec1TyConName,
928 k1TyConName, m1TyConName, sumTyConName, prodTyConName,
929 compTyConName, rTyConName, dTyConName,
930 cTyConName, sTyConName, rec0TyConName,
931 d1TyConName, c1TyConName, s1TyConName, noSelTyConName,
932 repTyConName, rep1TyConName, uRecTyConName,
933 uAddrTyConName, uCharTyConName, uDoubleTyConName,
934 uFloatTyConName, uIntTyConName, uWordTyConName,
935 prefixIDataConName, infixIDataConName, leftAssociativeDataConName,
936 rightAssociativeDataConName, notAssociativeDataConName,
937 sourceUnpackDataConName, sourceNoUnpackDataConName,
938 noSourceUnpackednessDataConName, sourceLazyDataConName,
939 sourceStrictDataConName, noSourceStrictnessDataConName,
940 decidedLazyDataConName, decidedStrictDataConName, decidedUnpackDataConName,
941 metaDataDataConName, metaConsDataConName, metaSelDataConName :: Name
942
943 v1TyConName = tcQual gHC_GENERICS (fsLit "V1") v1TyConKey
944 u1TyConName = tcQual gHC_GENERICS (fsLit "U1") u1TyConKey
945 par1TyConName = tcQual gHC_GENERICS (fsLit "Par1") par1TyConKey
946 rec1TyConName = tcQual gHC_GENERICS (fsLit "Rec1") rec1TyConKey
947 k1TyConName = tcQual gHC_GENERICS (fsLit "K1") k1TyConKey
948 m1TyConName = tcQual gHC_GENERICS (fsLit "M1") m1TyConKey
949
950 sumTyConName = tcQual gHC_GENERICS (fsLit ":+:") sumTyConKey
951 prodTyConName = tcQual gHC_GENERICS (fsLit ":*:") prodTyConKey
952 compTyConName = tcQual gHC_GENERICS (fsLit ":.:") compTyConKey
953
954 rTyConName = tcQual gHC_GENERICS (fsLit "R") rTyConKey
955 dTyConName = tcQual gHC_GENERICS (fsLit "D") dTyConKey
956 cTyConName = tcQual gHC_GENERICS (fsLit "C") cTyConKey
957 sTyConName = tcQual gHC_GENERICS (fsLit "S") sTyConKey
958
959 rec0TyConName = tcQual gHC_GENERICS (fsLit "Rec0") rec0TyConKey
960 d1TyConName = tcQual gHC_GENERICS (fsLit "D1") d1TyConKey
961 c1TyConName = tcQual gHC_GENERICS (fsLit "C1") c1TyConKey
962 s1TyConName = tcQual gHC_GENERICS (fsLit "S1") s1TyConKey
963 noSelTyConName = tcQual gHC_GENERICS (fsLit "NoSelector") noSelTyConKey
964
965 repTyConName = tcQual gHC_GENERICS (fsLit "Rep") repTyConKey
966 rep1TyConName = tcQual gHC_GENERICS (fsLit "Rep1") rep1TyConKey
967
968 uRecTyConName = tcQual gHC_GENERICS (fsLit "URec") uRecTyConKey
969 uAddrTyConName = tcQual gHC_GENERICS (fsLit "UAddr") uAddrTyConKey
970 uCharTyConName = tcQual gHC_GENERICS (fsLit "UChar") uCharTyConKey
971 uDoubleTyConName = tcQual gHC_GENERICS (fsLit "UDouble") uDoubleTyConKey
972 uFloatTyConName = tcQual gHC_GENERICS (fsLit "UFloat") uFloatTyConKey
973 uIntTyConName = tcQual gHC_GENERICS (fsLit "UInt") uIntTyConKey
974 uWordTyConName = tcQual gHC_GENERICS (fsLit "UWord") uWordTyConKey
975
976 prefixIDataConName = dcQual gHC_GENERICS (fsLit "PrefixI") prefixIDataConKey
977 infixIDataConName = dcQual gHC_GENERICS (fsLit "InfixI") infixIDataConKey
978 leftAssociativeDataConName = dcQual gHC_GENERICS (fsLit "LeftAssociative") leftAssociativeDataConKey
979 rightAssociativeDataConName = dcQual gHC_GENERICS (fsLit "RightAssociative") rightAssociativeDataConKey
980 notAssociativeDataConName = dcQual gHC_GENERICS (fsLit "NotAssociative") notAssociativeDataConKey
981
982 sourceUnpackDataConName = dcQual gHC_GENERICS (fsLit "SourceUnpack") sourceUnpackDataConKey
983 sourceNoUnpackDataConName = dcQual gHC_GENERICS (fsLit "SourceNoUnpack") sourceNoUnpackDataConKey
984 noSourceUnpackednessDataConName = dcQual gHC_GENERICS (fsLit "NoSourceUnpackedness") noSourceUnpackednessDataConKey
985 sourceLazyDataConName = dcQual gHC_GENERICS (fsLit "SourceLazy") sourceLazyDataConKey
986 sourceStrictDataConName = dcQual gHC_GENERICS (fsLit "SourceStrict") sourceStrictDataConKey
987 noSourceStrictnessDataConName = dcQual gHC_GENERICS (fsLit "NoSourceStrictness") noSourceStrictnessDataConKey
988 decidedLazyDataConName = dcQual gHC_GENERICS (fsLit "DecidedLazy") decidedLazyDataConKey
989 decidedStrictDataConName = dcQual gHC_GENERICS (fsLit "DecidedStrict") decidedStrictDataConKey
990 decidedUnpackDataConName = dcQual gHC_GENERICS (fsLit "DecidedUnpack") decidedUnpackDataConKey
991
992 metaDataDataConName = dcQual gHC_GENERICS (fsLit "MetaData") metaDataDataConKey
993 metaConsDataConName = dcQual gHC_GENERICS (fsLit "MetaCons") metaConsDataConKey
994 metaSelDataConName = dcQual gHC_GENERICS (fsLit "MetaSel") metaSelDataConKey
995
996 -- Primitive Int
997 divIntName, modIntName :: Name
998 divIntName = varQual gHC_CLASSES (fsLit "divInt#") divIntIdKey
999 modIntName = varQual gHC_CLASSES (fsLit "modInt#") modIntIdKey
1000
1001 -- Base strings Strings
1002 unpackCStringName, unpackCStringFoldrName,
1003 unpackCStringUtf8Name, eqStringName :: Name
1004 unpackCStringName = varQual gHC_CSTRING (fsLit "unpackCString#") unpackCStringIdKey
1005 unpackCStringFoldrName = varQual gHC_CSTRING (fsLit "unpackFoldrCString#") unpackCStringFoldrIdKey
1006 unpackCStringUtf8Name = varQual gHC_CSTRING (fsLit "unpackCStringUtf8#") unpackCStringUtf8IdKey
1007 eqStringName = varQual gHC_BASE (fsLit "eqString") eqStringIdKey
1008
1009 -- The 'inline' function
1010 inlineIdName :: Name
1011 inlineIdName = varQual gHC_MAGIC (fsLit "inline") inlineIdKey
1012
1013 -- Base classes (Eq, Ord, Functor)
1014 fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name
1015 eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey
1016 eqName = varQual gHC_CLASSES (fsLit "==") eqClassOpKey
1017 ordClassName = clsQual gHC_CLASSES (fsLit "Ord") ordClassKey
1018 geName = varQual gHC_CLASSES (fsLit ">=") geClassOpKey
1019 functorClassName = clsQual gHC_BASE (fsLit "Functor") functorClassKey
1020 fmapName = varQual gHC_BASE (fsLit "fmap") fmapClassOpKey
1021
1022 -- Class Monad
1023 monadClassName, thenMName, bindMName, returnMName :: Name
1024 monadClassName = clsQual gHC_BASE (fsLit "Monad") monadClassKey
1025 thenMName = varQual gHC_BASE (fsLit ">>") thenMClassOpKey
1026 bindMName = varQual gHC_BASE (fsLit ">>=") bindMClassOpKey
1027 returnMName = varQual gHC_BASE (fsLit "return") returnMClassOpKey
1028
1029 -- Class MonadFail
1030 monadFailClassName, failMName :: Name
1031 monadFailClassName = clsQual mONAD_FAIL (fsLit "MonadFail") monadFailClassKey
1032 failMName = varQual mONAD_FAIL (fsLit "fail") failMClassOpKey
1033
1034 -- Class Applicative
1035 applicativeClassName, pureAName, apAName, thenAName :: Name
1036 applicativeClassName = clsQual gHC_BASE (fsLit "Applicative") applicativeClassKey
1037 apAName = varQual gHC_BASE (fsLit "<*>") apAClassOpKey
1038 pureAName = varQual gHC_BASE (fsLit "pure") pureAClassOpKey
1039 thenAName = varQual gHC_BASE (fsLit "*>") thenAClassOpKey
1040
1041 -- Classes (Foldable, Traversable)
1042 foldableClassName, traversableClassName :: Name
1043 foldableClassName = clsQual dATA_FOLDABLE (fsLit "Foldable") foldableClassKey
1044 traversableClassName = clsQual dATA_TRAVERSABLE (fsLit "Traversable") traversableClassKey
1045
1046 -- Classes (Semigroup, Monoid)
1047 semigroupClassName, sappendName :: Name
1048 semigroupClassName = clsQual gHC_BASE (fsLit "Semigroup") semigroupClassKey
1049 sappendName = varQual gHC_BASE (fsLit "<>") sappendClassOpKey
1050 monoidClassName, memptyName, mappendName, mconcatName :: Name
1051 monoidClassName = clsQual gHC_BASE (fsLit "Monoid") monoidClassKey
1052 memptyName = varQual gHC_BASE (fsLit "mempty") memptyClassOpKey
1053 mappendName = varQual gHC_BASE (fsLit "mappend") mappendClassOpKey
1054 mconcatName = varQual gHC_BASE (fsLit "mconcat") mconcatClassOpKey
1055
1056
1057
1058 -- AMP additions
1059
1060 joinMName, alternativeClassName :: Name
1061 joinMName = varQual gHC_BASE (fsLit "join") joinMIdKey
1062 alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey
1063
1064 --
1065 joinMIdKey, apAClassOpKey, pureAClassOpKey, thenAClassOpKey,
1066 alternativeClassKey :: Unique
1067 joinMIdKey = mkPreludeMiscIdUnique 750
1068 apAClassOpKey = mkPreludeMiscIdUnique 751 -- <*>
1069 pureAClassOpKey = mkPreludeMiscIdUnique 752
1070 thenAClassOpKey = mkPreludeMiscIdUnique 753
1071 alternativeClassKey = mkPreludeMiscIdUnique 754
1072
1073
1074 -- Functions for GHC extensions
1075 groupWithName :: Name
1076 groupWithName = varQual gHC_EXTS (fsLit "groupWith") groupWithIdKey
1077
1078 -- Random PrelBase functions
1079 fromStringName, otherwiseIdName, foldrName, buildName, augmentName,
1080 mapName, appendName, assertName,
1081 breakpointName, breakpointCondName,
1082 opaqueTyConName, dollarName :: Name
1083 dollarName = varQual gHC_BASE (fsLit "$") dollarIdKey
1084 otherwiseIdName = varQual gHC_BASE (fsLit "otherwise") otherwiseIdKey
1085 foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey
1086 buildName = varQual gHC_BASE (fsLit "build") buildIdKey
1087 augmentName = varQual gHC_BASE (fsLit "augment") augmentIdKey
1088 mapName = varQual gHC_BASE (fsLit "map") mapIdKey
1089 appendName = varQual gHC_BASE (fsLit "++") appendIdKey
1090 assertName = varQual gHC_BASE (fsLit "assert") assertIdKey
1091 breakpointName = varQual gHC_BASE (fsLit "breakpoint") breakpointIdKey
1092 breakpointCondName= varQual gHC_BASE (fsLit "breakpointCond") breakpointCondIdKey
1093 opaqueTyConName = tcQual gHC_BASE (fsLit "Opaque") opaqueTyConKey
1094 fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
1095
1096 -- PrelTup
1097 fstName, sndName :: Name
1098 fstName = varQual dATA_TUPLE (fsLit "fst") fstIdKey
1099 sndName = varQual dATA_TUPLE (fsLit "snd") sndIdKey
1100
1101 -- Module GHC.Num
1102 numClassName, fromIntegerName, minusName, negateName :: Name
1103 numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey
1104 fromIntegerName = varQual gHC_NUM (fsLit "fromInteger") fromIntegerClassOpKey
1105 minusName = varQual gHC_NUM (fsLit "-") minusClassOpKey
1106 negateName = varQual gHC_NUM (fsLit "negate") negateClassOpKey
1107
1108 integerTyConName, mkIntegerName, integerSDataConName,
1109 integerToWord64Name, integerToInt64Name,
1110 word64ToIntegerName, int64ToIntegerName,
1111 plusIntegerName, timesIntegerName, smallIntegerName,
1112 wordToIntegerName,
1113 integerToWordName, integerToIntName, minusIntegerName,
1114 negateIntegerName, eqIntegerPrimName, neqIntegerPrimName,
1115 absIntegerName, signumIntegerName,
1116 leIntegerPrimName, gtIntegerPrimName, ltIntegerPrimName, geIntegerPrimName,
1117 compareIntegerName, quotRemIntegerName, divModIntegerName,
1118 quotIntegerName, remIntegerName, divIntegerName, modIntegerName,
1119 floatFromIntegerName, doubleFromIntegerName,
1120 encodeFloatIntegerName, encodeDoubleIntegerName,
1121 decodeDoubleIntegerName,
1122 gcdIntegerName, lcmIntegerName,
1123 andIntegerName, orIntegerName, xorIntegerName, complementIntegerName,
1124 shiftLIntegerName, shiftRIntegerName, bitIntegerName :: Name
1125 integerTyConName = tcQual gHC_INTEGER_TYPE (fsLit "Integer") integerTyConKey
1126 integerSDataConName = dcQual gHC_INTEGER_TYPE (fsLit "S#") integerSDataConKey
1127 mkIntegerName = varQual gHC_INTEGER_TYPE (fsLit "mkInteger") mkIntegerIdKey
1128 integerToWord64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToWord64") integerToWord64IdKey
1129 integerToInt64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToInt64") integerToInt64IdKey
1130 word64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "word64ToInteger") word64ToIntegerIdKey
1131 int64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "int64ToInteger") int64ToIntegerIdKey
1132 plusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "plusInteger") plusIntegerIdKey
1133 timesIntegerName = varQual gHC_INTEGER_TYPE (fsLit "timesInteger") timesIntegerIdKey
1134 smallIntegerName = varQual gHC_INTEGER_TYPE (fsLit "smallInteger") smallIntegerIdKey
1135 wordToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "wordToInteger") wordToIntegerIdKey
1136 integerToWordName = varQual gHC_INTEGER_TYPE (fsLit "integerToWord") integerToWordIdKey
1137 integerToIntName = varQual gHC_INTEGER_TYPE (fsLit "integerToInt") integerToIntIdKey
1138 minusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "minusInteger") minusIntegerIdKey
1139 negateIntegerName = varQual gHC_INTEGER_TYPE (fsLit "negateInteger") negateIntegerIdKey
1140 eqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "eqInteger#") eqIntegerPrimIdKey
1141 neqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "neqInteger#") neqIntegerPrimIdKey
1142 absIntegerName = varQual gHC_INTEGER_TYPE (fsLit "absInteger") absIntegerIdKey
1143 signumIntegerName = varQual gHC_INTEGER_TYPE (fsLit "signumInteger") signumIntegerIdKey
1144 leIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "leInteger#") leIntegerPrimIdKey
1145 gtIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "gtInteger#") gtIntegerPrimIdKey
1146 ltIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "ltInteger#") ltIntegerPrimIdKey
1147 geIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "geInteger#") geIntegerPrimIdKey
1148 compareIntegerName = varQual gHC_INTEGER_TYPE (fsLit "compareInteger") compareIntegerIdKey
1149 quotRemIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotRemInteger") quotRemIntegerIdKey
1150 divModIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divModInteger") divModIntegerIdKey
1151 quotIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotInteger") quotIntegerIdKey
1152 remIntegerName = varQual gHC_INTEGER_TYPE (fsLit "remInteger") remIntegerIdKey
1153 divIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divInteger") divIntegerIdKey
1154 modIntegerName = varQual gHC_INTEGER_TYPE (fsLit "modInteger") modIntegerIdKey
1155 floatFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "floatFromInteger") floatFromIntegerIdKey
1156 doubleFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "doubleFromInteger") doubleFromIntegerIdKey
1157 encodeFloatIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeFloatInteger") encodeFloatIntegerIdKey
1158 encodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeDoubleInteger") encodeDoubleIntegerIdKey
1159 decodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "decodeDoubleInteger") decodeDoubleIntegerIdKey
1160 gcdIntegerName = varQual gHC_INTEGER_TYPE (fsLit "gcdInteger") gcdIntegerIdKey
1161 lcmIntegerName = varQual gHC_INTEGER_TYPE (fsLit "lcmInteger") lcmIntegerIdKey
1162 andIntegerName = varQual gHC_INTEGER_TYPE (fsLit "andInteger") andIntegerIdKey
1163 orIntegerName = varQual gHC_INTEGER_TYPE (fsLit "orInteger") orIntegerIdKey
1164 xorIntegerName = varQual gHC_INTEGER_TYPE (fsLit "xorInteger") xorIntegerIdKey
1165 complementIntegerName = varQual gHC_INTEGER_TYPE (fsLit "complementInteger") complementIntegerIdKey
1166 shiftLIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftLInteger") shiftLIntegerIdKey
1167 shiftRIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftRInteger") shiftRIntegerIdKey
1168 bitIntegerName = varQual gHC_INTEGER_TYPE (fsLit "bitInteger") bitIntegerIdKey
1169
1170 -- GHC.Natural types
1171 naturalTyConName, naturalSDataConName :: Name
1172 naturalTyConName = tcQual gHC_NATURAL (fsLit "Natural") naturalTyConKey
1173 naturalSDataConName = dcQual gHC_NATURAL (fsLit "NatS#") naturalSDataConKey
1174
1175 naturalFromIntegerName :: Name
1176 naturalFromIntegerName = varQual gHC_NATURAL (fsLit "naturalFromInteger") naturalFromIntegerIdKey
1177
1178 naturalToIntegerName, plusNaturalName, minusNaturalName, timesNaturalName,
1179 mkNaturalName, wordToNaturalName :: Name
1180 naturalToIntegerName = varQual gHC_NATURAL (fsLit "naturalToInteger") naturalToIntegerIdKey
1181 plusNaturalName = varQual gHC_NATURAL (fsLit "plusNatural") plusNaturalIdKey
1182 minusNaturalName = varQual gHC_NATURAL (fsLit "minusNatural") minusNaturalIdKey
1183 timesNaturalName = varQual gHC_NATURAL (fsLit "timesNatural") timesNaturalIdKey
1184 mkNaturalName = varQual gHC_NATURAL (fsLit "mkNatural") mkNaturalIdKey
1185 wordToNaturalName = varQual gHC_NATURAL (fsLit "wordToNatural#") wordToNaturalIdKey
1186
1187 -- GHC.Real types and classes
1188 rationalTyConName, ratioTyConName, ratioDataConName, realClassName,
1189 integralClassName, realFracClassName, fractionalClassName,
1190 fromRationalName, toIntegerName, toRationalName, fromIntegralName,
1191 realToFracName :: Name
1192 rationalTyConName = tcQual gHC_REAL (fsLit "Rational") rationalTyConKey
1193 ratioTyConName = tcQual gHC_REAL (fsLit "Ratio") ratioTyConKey
1194 ratioDataConName = dcQual gHC_REAL (fsLit ":%") ratioDataConKey
1195 realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey
1196 integralClassName = clsQual gHC_REAL (fsLit "Integral") integralClassKey
1197 realFracClassName = clsQual gHC_REAL (fsLit "RealFrac") realFracClassKey
1198 fractionalClassName = clsQual gHC_REAL (fsLit "Fractional") fractionalClassKey
1199 fromRationalName = varQual gHC_REAL (fsLit "fromRational") fromRationalClassOpKey
1200 toIntegerName = varQual gHC_REAL (fsLit "toInteger") toIntegerClassOpKey
1201 toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey
1202 fromIntegralName = varQual gHC_REAL (fsLit "fromIntegral")fromIntegralIdKey
1203 realToFracName = varQual gHC_REAL (fsLit "realToFrac") realToFracIdKey
1204
1205 -- PrelFloat classes
1206 floatingClassName, realFloatClassName :: Name
1207 floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey
1208 realFloatClassName = clsQual gHC_FLOAT (fsLit "RealFloat") realFloatClassKey
1209
1210 -- other GHC.Float functions
1211 rationalToFloatName, rationalToDoubleName :: Name
1212 rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey
1213 rationalToDoubleName = varQual gHC_FLOAT (fsLit "rationalToDouble") rationalToDoubleIdKey
1214
1215 -- Class Ix
1216 ixClassName :: Name
1217 ixClassName = clsQual gHC_IX (fsLit "Ix") ixClassKey
1218
1219 -- Typeable representation types
1220 trModuleTyConName
1221 , trModuleDataConName
1222 , trNameTyConName
1223 , trNameSDataConName
1224 , trNameDDataConName
1225 , trTyConTyConName
1226 , trTyConDataConName
1227 :: Name
1228 trModuleTyConName = tcQual gHC_TYPES (fsLit "Module") trModuleTyConKey
1229 trModuleDataConName = dcQual gHC_TYPES (fsLit "Module") trModuleDataConKey
1230 trNameTyConName = tcQual gHC_TYPES (fsLit "TrName") trNameTyConKey
1231 trNameSDataConName = dcQual gHC_TYPES (fsLit "TrNameS") trNameSDataConKey
1232 trNameDDataConName = dcQual gHC_TYPES (fsLit "TrNameD") trNameDDataConKey
1233 trTyConTyConName = tcQual gHC_TYPES (fsLit "TyCon") trTyConTyConKey
1234 trTyConDataConName = dcQual gHC_TYPES (fsLit "TyCon") trTyConDataConKey
1235
1236 kindRepTyConName
1237 , kindRepTyConAppDataConName
1238 , kindRepVarDataConName
1239 , kindRepAppDataConName
1240 , kindRepFunDataConName
1241 , kindRepTYPEDataConName
1242 , kindRepTypeLitSDataConName
1243 , kindRepTypeLitDDataConName
1244 :: Name
1245 kindRepTyConName = tcQual gHC_TYPES (fsLit "KindRep") kindRepTyConKey
1246 kindRepTyConAppDataConName = dcQual gHC_TYPES (fsLit "KindRepTyConApp") kindRepTyConAppDataConKey
1247 kindRepVarDataConName = dcQual gHC_TYPES (fsLit "KindRepVar") kindRepVarDataConKey
1248 kindRepAppDataConName = dcQual gHC_TYPES (fsLit "KindRepApp") kindRepAppDataConKey
1249 kindRepFunDataConName = dcQual gHC_TYPES (fsLit "KindRepFun") kindRepFunDataConKey
1250 kindRepTYPEDataConName = dcQual gHC_TYPES (fsLit "KindRepTYPE") kindRepTYPEDataConKey
1251 kindRepTypeLitSDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitS") kindRepTypeLitSDataConKey
1252 kindRepTypeLitDDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitD") kindRepTypeLitDDataConKey
1253
1254 typeLitSortTyConName
1255 , typeLitSymbolDataConName
1256 , typeLitNatDataConName
1257 :: Name
1258 typeLitSortTyConName = tcQual gHC_TYPES (fsLit "TypeLitSort") typeLitSortTyConKey
1259 typeLitSymbolDataConName = dcQual gHC_TYPES (fsLit "TypeLitSymbol") typeLitSymbolDataConKey
1260 typeLitNatDataConName = dcQual gHC_TYPES (fsLit "TypeLitNat") typeLitNatDataConKey
1261
1262 -- Class Typeable, and functions for constructing `Typeable` dictionaries
1263 typeableClassName
1264 , typeRepTyConName
1265 , someTypeRepTyConName
1266 , someTypeRepDataConName
1267 , mkTrTypeName
1268 , mkTrConName
1269 , mkTrAppName
1270 , mkTrFunName
1271 , typeRepIdName
1272 , typeNatTypeRepName
1273 , typeSymbolTypeRepName
1274 , trGhcPrimModuleName
1275 :: Name
1276 typeableClassName = clsQual tYPEABLE_INTERNAL (fsLit "Typeable") typeableClassKey
1277 typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey
1278 someTypeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepTyConKey
1279 someTypeRepDataConName = dcQual tYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepDataConKey
1280 typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
1281 mkTrTypeName = varQual tYPEABLE_INTERNAL (fsLit "mkTrType") mkTrTypeKey
1282 mkTrConName = varQual tYPEABLE_INTERNAL (fsLit "mkTrCon") mkTrConKey
1283 mkTrAppName = varQual tYPEABLE_INTERNAL (fsLit "mkTrApp") mkTrAppKey
1284 mkTrFunName = varQual tYPEABLE_INTERNAL (fsLit "mkTrFun") mkTrFunKey
1285 typeNatTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeNatTypeRep") typeNatTypeRepKey
1286 typeSymbolTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeSymbolTypeRep") typeSymbolTypeRepKey
1287 -- this is the Typeable 'Module' for GHC.Prim (which has no code, so we place in GHC.Types)
1288 -- See Note [Grand plan for Typeable] in TcTypeable.
1289 trGhcPrimModuleName = varQual gHC_TYPES (fsLit "tr$ModuleGHCPrim") trGhcPrimModuleKey
1290
1291 -- Typeable KindReps for some common cases
1292 starKindRepName, starArrStarKindRepName, starArrStarArrStarKindRepName :: Name
1293 starKindRepName = varQual gHC_TYPES (fsLit "krep$*") starKindRepKey
1294 starArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*Arr*") starArrStarKindRepKey
1295 starArrStarArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*->*->*") starArrStarArrStarKindRepKey
1296
1297 -- Custom type errors
1298 errorMessageTypeErrorFamName
1299 , typeErrorTextDataConName
1300 , typeErrorAppendDataConName
1301 , typeErrorVAppendDataConName
1302 , typeErrorShowTypeDataConName
1303 :: Name
1304
1305 errorMessageTypeErrorFamName =
1306 tcQual gHC_TYPELITS (fsLit "TypeError") errorMessageTypeErrorFamKey
1307
1308 typeErrorTextDataConName =
1309 dcQual gHC_TYPELITS (fsLit "Text") typeErrorTextDataConKey
1310
1311 typeErrorAppendDataConName =
1312 dcQual gHC_TYPELITS (fsLit ":<>:") typeErrorAppendDataConKey
1313
1314 typeErrorVAppendDataConName =
1315 dcQual gHC_TYPELITS (fsLit ":$$:") typeErrorVAppendDataConKey
1316
1317 typeErrorShowTypeDataConName =
1318 dcQual gHC_TYPELITS (fsLit "ShowType") typeErrorShowTypeDataConKey
1319
1320
1321
1322 -- Dynamic
1323 toDynName :: Name
1324 toDynName = varQual dYNAMIC (fsLit "toDyn") toDynIdKey
1325
1326 -- Class Data
1327 dataClassName :: Name
1328 dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey
1329
1330 -- Error module
1331 assertErrorName :: Name
1332 assertErrorName = varQual gHC_IO_Exception (fsLit "assertError") assertErrorIdKey
1333
1334 -- Debug.Trace
1335 traceName :: Name
1336 traceName = varQual dEBUG_TRACE (fsLit "trace") traceKey
1337
1338 -- Enum module (Enum, Bounded)
1339 enumClassName, enumFromName, enumFromToName, enumFromThenName,
1340 enumFromThenToName, boundedClassName :: Name
1341 enumClassName = clsQual gHC_ENUM (fsLit "Enum") enumClassKey
1342 enumFromName = varQual gHC_ENUM (fsLit "enumFrom") enumFromClassOpKey
1343 enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey
1344 enumFromThenName = varQual gHC_ENUM (fsLit "enumFromThen") enumFromThenClassOpKey
1345 enumFromThenToName = varQual gHC_ENUM (fsLit "enumFromThenTo") enumFromThenToClassOpKey
1346 boundedClassName = clsQual gHC_ENUM (fsLit "Bounded") boundedClassKey
1347
1348 -- List functions
1349 concatName, filterName, zipName :: Name
1350 concatName = varQual gHC_LIST (fsLit "concat") concatIdKey
1351 filterName = varQual gHC_LIST (fsLit "filter") filterIdKey
1352 zipName = varQual gHC_LIST (fsLit "zip") zipIdKey
1353
1354 -- Overloaded lists
1355 isListClassName, fromListName, fromListNName, toListName :: Name
1356 isListClassName = clsQual gHC_EXTS (fsLit "IsList") isListClassKey
1357 fromListName = varQual gHC_EXTS (fsLit "fromList") fromListClassOpKey
1358 fromListNName = varQual gHC_EXTS (fsLit "fromListN") fromListNClassOpKey
1359 toListName = varQual gHC_EXTS (fsLit "toList") toListClassOpKey
1360
1361 -- Class Show
1362 showClassName :: Name
1363 showClassName = clsQual gHC_SHOW (fsLit "Show") showClassKey
1364
1365 -- Class Read
1366 readClassName :: Name
1367 readClassName = clsQual gHC_READ (fsLit "Read") readClassKey
1368
1369 -- Classes Generic and Generic1, Datatype, Constructor and Selector
1370 genClassName, gen1ClassName, datatypeClassName, constructorClassName,
1371 selectorClassName :: Name
1372 genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey
1373 gen1ClassName = clsQual gHC_GENERICS (fsLit "Generic1") gen1ClassKey
1374
1375 datatypeClassName = clsQual gHC_GENERICS (fsLit "Datatype") datatypeClassKey
1376 constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey
1377 selectorClassName = clsQual gHC_GENERICS (fsLit "Selector") selectorClassKey
1378
1379 genericClassNames :: [Name]
1380 genericClassNames = [genClassName, gen1ClassName]
1381
1382 -- GHCi things
1383 ghciIoClassName, ghciStepIoMName :: Name
1384 ghciIoClassName = clsQual gHC_GHCI (fsLit "GHCiSandboxIO") ghciIoClassKey
1385 ghciStepIoMName = varQual gHC_GHCI (fsLit "ghciStepIO") ghciStepIoMClassOpKey
1386
1387 -- IO things
1388 ioTyConName, ioDataConName,
1389 thenIOName, bindIOName, returnIOName, failIOName :: Name
1390 ioTyConName = tcQual gHC_TYPES (fsLit "IO") ioTyConKey
1391 ioDataConName = dcQual gHC_TYPES (fsLit "IO") ioDataConKey
1392 thenIOName = varQual gHC_BASE (fsLit "thenIO") thenIOIdKey
1393 bindIOName = varQual gHC_BASE (fsLit "bindIO") bindIOIdKey
1394 returnIOName = varQual gHC_BASE (fsLit "returnIO") returnIOIdKey
1395 failIOName = varQual gHC_IO (fsLit "failIO") failIOIdKey
1396
1397 -- IO things
1398 printName :: Name
1399 printName = varQual sYSTEM_IO (fsLit "print") printIdKey
1400
1401 -- Int, Word, and Addr things
1402 int8TyConName, int16TyConName, int32TyConName, int64TyConName :: Name
1403 int8TyConName = tcQual gHC_INT (fsLit "Int8") int8TyConKey
1404 int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey
1405 int32TyConName = tcQual gHC_INT (fsLit "Int32") int32TyConKey
1406 int64TyConName = tcQual gHC_INT (fsLit "Int64") int64TyConKey
1407
1408 -- Word module
1409 word16TyConName, word32TyConName, word64TyConName :: Name
1410 word16TyConName = tcQual gHC_WORD (fsLit "Word16") word16TyConKey
1411 word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
1412 word64TyConName = tcQual gHC_WORD (fsLit "Word64") word64TyConKey
1413
1414 -- PrelPtr module
1415 ptrTyConName, funPtrTyConName :: Name
1416 ptrTyConName = tcQual gHC_PTR (fsLit "Ptr") ptrTyConKey
1417 funPtrTyConName = tcQual gHC_PTR (fsLit "FunPtr") funPtrTyConKey
1418
1419 -- Foreign objects and weak pointers
1420 stablePtrTyConName, newStablePtrName :: Name
1421 stablePtrTyConName = tcQual gHC_STABLE (fsLit "StablePtr") stablePtrTyConKey
1422 newStablePtrName = varQual gHC_STABLE (fsLit "newStablePtr") newStablePtrIdKey
1423
1424 -- Recursive-do notation
1425 monadFixClassName, mfixName :: Name
1426 monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey
1427 mfixName = varQual mONAD_FIX (fsLit "mfix") mfixIdKey
1428
1429 -- Arrow notation
1430 arrAName, composeAName, firstAName, appAName, choiceAName, loopAName :: Name
1431 arrAName = varQual aRROW (fsLit "arr") arrAIdKey
1432 composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey
1433 firstAName = varQual aRROW (fsLit "first") firstAIdKey
1434 appAName = varQual aRROW (fsLit "app") appAIdKey
1435 choiceAName = varQual aRROW (fsLit "|||") choiceAIdKey
1436 loopAName = varQual aRROW (fsLit "loop") loopAIdKey
1437
1438 -- Monad comprehensions
1439 guardMName, liftMName, mzipName :: Name
1440 guardMName = varQual mONAD (fsLit "guard") guardMIdKey
1441 liftMName = varQual mONAD (fsLit "liftM") liftMIdKey
1442 mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey
1443
1444
1445 -- Annotation type checking
1446 toAnnotationWrapperName :: Name
1447 toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey
1448
1449 -- Other classes, needed for type defaulting
1450 monadPlusClassName, randomClassName, randomGenClassName,
1451 isStringClassName :: Name
1452 monadPlusClassName = clsQual mONAD (fsLit "MonadPlus") monadPlusClassKey
1453 randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey
1454 randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey
1455 isStringClassName = clsQual dATA_STRING (fsLit "IsString") isStringClassKey
1456
1457 -- Type-level naturals
1458 knownNatClassName :: Name
1459 knownNatClassName = clsQual gHC_TYPENATS (fsLit "KnownNat") knownNatClassNameKey
1460 knownSymbolClassName :: Name
1461 knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey
1462
1463 -- Overloaded labels
1464 isLabelClassName :: Name
1465 isLabelClassName
1466 = clsQual gHC_OVER_LABELS (fsLit "IsLabel") isLabelClassNameKey
1467
1468 -- Implicit Parameters
1469 ipClassName :: Name
1470 ipClassName
1471 = clsQual gHC_CLASSES (fsLit "IP") ipClassKey
1472
1473 -- Overloaded record fields
1474 hasFieldClassName :: Name
1475 hasFieldClassName
1476 = clsQual gHC_RECORDS (fsLit "HasField") hasFieldClassNameKey
1477
1478 -- Source Locations
1479 callStackTyConName, emptyCallStackName, pushCallStackName,
1480 srcLocDataConName :: Name
1481 callStackTyConName
1482 = tcQual gHC_STACK_TYPES (fsLit "CallStack") callStackTyConKey
1483 emptyCallStackName
1484 = varQual gHC_STACK_TYPES (fsLit "emptyCallStack") emptyCallStackKey
1485 pushCallStackName
1486 = varQual gHC_STACK_TYPES (fsLit "pushCallStack") pushCallStackKey
1487 srcLocDataConName
1488 = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey
1489
1490 -- plugins
1491 pLUGINS :: Module
1492 pLUGINS = mkThisGhcModule (fsLit "Plugins")
1493 pluginTyConName :: Name
1494 pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
1495 frontendPluginTyConName :: Name
1496 frontendPluginTyConName = tcQual pLUGINS (fsLit "FrontendPlugin") frontendPluginTyConKey
1497
1498 -- Static pointers
1499 makeStaticName :: Name
1500 makeStaticName =
1501 varQual gHC_STATICPTR_INTERNAL (fsLit "makeStatic") makeStaticKey
1502
1503 staticPtrInfoTyConName :: Name
1504 staticPtrInfoTyConName =
1505 tcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoTyConKey
1506
1507 staticPtrInfoDataConName :: Name
1508 staticPtrInfoDataConName =
1509 dcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoDataConKey
1510
1511 staticPtrTyConName :: Name
1512 staticPtrTyConName =
1513 tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
1514
1515 staticPtrDataConName :: Name
1516 staticPtrDataConName =
1517 dcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrDataConKey
1518
1519 fromStaticPtrName :: Name
1520 fromStaticPtrName =
1521 varQual gHC_STATICPTR (fsLit "fromStaticPtr") fromStaticPtrClassOpKey
1522
1523 fingerprintDataConName :: Name
1524 fingerprintDataConName =
1525 dcQual gHC_FINGERPRINT_TYPE (fsLit "Fingerprint") fingerprintDataConKey
1526
1527 {-
1528 ************************************************************************
1529 * *
1530 \subsection{Local helpers}
1531 * *
1532 ************************************************************************
1533
1534 All these are original names; hence mkOrig
1535 -}
1536
1537 varQual, tcQual, clsQual, dcQual :: Module -> FastString -> Unique -> Name
1538 varQual = mk_known_key_name varName
1539 tcQual = mk_known_key_name tcName
1540 clsQual = mk_known_key_name clsName
1541 dcQual = mk_known_key_name dataName
1542
1543 mk_known_key_name :: NameSpace -> Module -> FastString -> Unique -> Name
1544 mk_known_key_name space modu str unique
1545 = mkExternalName unique modu (mkOccNameFS space str) noSrcSpan
1546
1547
1548 {-
1549 ************************************************************************
1550 * *
1551 \subsubsection[Uniques-prelude-Classes]{@Uniques@ for wired-in @Classes@}
1552 * *
1553 ************************************************************************
1554 --MetaHaskell extension hand allocate keys here
1555 -}
1556
1557 boundedClassKey, enumClassKey, eqClassKey, floatingClassKey,
1558 fractionalClassKey, integralClassKey, monadClassKey, dataClassKey,
1559 functorClassKey, numClassKey, ordClassKey, readClassKey, realClassKey,
1560 realFloatClassKey, realFracClassKey, showClassKey, ixClassKey :: Unique
1561 boundedClassKey = mkPreludeClassUnique 1
1562 enumClassKey = mkPreludeClassUnique 2
1563 eqClassKey = mkPreludeClassUnique 3
1564 floatingClassKey = mkPreludeClassUnique 5
1565 fractionalClassKey = mkPreludeClassUnique 6
1566 integralClassKey = mkPreludeClassUnique 7
1567 monadClassKey = mkPreludeClassUnique 8
1568 dataClassKey = mkPreludeClassUnique 9
1569 functorClassKey = mkPreludeClassUnique 10
1570 numClassKey = mkPreludeClassUnique 11
1571 ordClassKey = mkPreludeClassUnique 12
1572 readClassKey = mkPreludeClassUnique 13
1573 realClassKey = mkPreludeClassUnique 14
1574 realFloatClassKey = mkPreludeClassUnique 15
1575 realFracClassKey = mkPreludeClassUnique 16
1576 showClassKey = mkPreludeClassUnique 17
1577 ixClassKey = mkPreludeClassUnique 18
1578
1579 typeableClassKey, typeable1ClassKey, typeable2ClassKey, typeable3ClassKey,
1580 typeable4ClassKey, typeable5ClassKey, typeable6ClassKey, typeable7ClassKey
1581 :: Unique
1582 typeableClassKey = mkPreludeClassUnique 20
1583 typeable1ClassKey = mkPreludeClassUnique 21
1584 typeable2ClassKey = mkPreludeClassUnique 22
1585 typeable3ClassKey = mkPreludeClassUnique 23
1586 typeable4ClassKey = mkPreludeClassUnique 24
1587 typeable5ClassKey = mkPreludeClassUnique 25
1588 typeable6ClassKey = mkPreludeClassUnique 26
1589 typeable7ClassKey = mkPreludeClassUnique 27
1590
1591 monadFixClassKey :: Unique
1592 monadFixClassKey = mkPreludeClassUnique 28
1593
1594 monadFailClassKey :: Unique
1595 monadFailClassKey = mkPreludeClassUnique 29
1596
1597 monadPlusClassKey, randomClassKey, randomGenClassKey :: Unique
1598 monadPlusClassKey = mkPreludeClassUnique 30
1599 randomClassKey = mkPreludeClassUnique 31
1600 randomGenClassKey = mkPreludeClassUnique 32
1601
1602 isStringClassKey :: Unique
1603 isStringClassKey = mkPreludeClassUnique 33
1604
1605 applicativeClassKey, foldableClassKey, traversableClassKey :: Unique
1606 applicativeClassKey = mkPreludeClassUnique 34
1607 foldableClassKey = mkPreludeClassUnique 35
1608 traversableClassKey = mkPreludeClassUnique 36
1609
1610 genClassKey, gen1ClassKey, datatypeClassKey, constructorClassKey,
1611 selectorClassKey :: Unique
1612 genClassKey = mkPreludeClassUnique 37
1613 gen1ClassKey = mkPreludeClassUnique 38
1614
1615 datatypeClassKey = mkPreludeClassUnique 39
1616 constructorClassKey = mkPreludeClassUnique 40
1617 selectorClassKey = mkPreludeClassUnique 41
1618
1619 -- KnownNat: see Note [KnowNat & KnownSymbol and EvLit] in TcEvidence
1620 knownNatClassNameKey :: Unique
1621 knownNatClassNameKey = mkPreludeClassUnique 42
1622
1623 -- KnownSymbol: see Note [KnownNat & KnownSymbol and EvLit] in TcEvidence
1624 knownSymbolClassNameKey :: Unique
1625 knownSymbolClassNameKey = mkPreludeClassUnique 43
1626
1627 ghciIoClassKey :: Unique
1628 ghciIoClassKey = mkPreludeClassUnique 44
1629
1630 isLabelClassNameKey :: Unique
1631 isLabelClassNameKey = mkPreludeClassUnique 45
1632
1633 semigroupClassKey, monoidClassKey :: Unique
1634 semigroupClassKey = mkPreludeClassUnique 46
1635 monoidClassKey = mkPreludeClassUnique 47
1636
1637 -- Implicit Parameters
1638 ipClassKey :: Unique
1639 ipClassKey = mkPreludeClassUnique 48
1640
1641 -- Overloaded record fields
1642 hasFieldClassNameKey :: Unique
1643 hasFieldClassNameKey = mkPreludeClassUnique 49
1644
1645
1646 ---------------- Template Haskell -------------------
1647 -- THNames.hs: USES ClassUniques 200-299
1648 -----------------------------------------------------
1649
1650 {-
1651 ************************************************************************
1652 * *
1653 \subsubsection[Uniques-prelude-TyCons]{@Uniques@ for wired-in @TyCons@}
1654 * *
1655 ************************************************************************
1656 -}
1657
1658 addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey,
1659 byteArrayPrimTyConKey, charPrimTyConKey, charTyConKey, doublePrimTyConKey,
1660 doubleTyConKey, floatPrimTyConKey, floatTyConKey, funTyConKey,
1661 intPrimTyConKey, intTyConKey, int8TyConKey, int16TyConKey,
1662 int8PrimTyConKey, int16PrimTyConKey, int32PrimTyConKey, int32TyConKey,
1663 int64PrimTyConKey, int64TyConKey,
1664 integerTyConKey, naturalTyConKey,
1665 listTyConKey, foreignObjPrimTyConKey, maybeTyConKey,
1666 weakPrimTyConKey, mutableArrayPrimTyConKey, mutableArrayArrayPrimTyConKey,
1667 mutableByteArrayPrimTyConKey, orderingTyConKey, mVarPrimTyConKey,
1668 ratioTyConKey, rationalTyConKey, realWorldTyConKey, stablePtrPrimTyConKey,
1669 stablePtrTyConKey, eqTyConKey, heqTyConKey,
1670 smallArrayPrimTyConKey, smallMutableArrayPrimTyConKey :: Unique
1671 addrPrimTyConKey = mkPreludeTyConUnique 1
1672 arrayPrimTyConKey = mkPreludeTyConUnique 3
1673 boolTyConKey = mkPreludeTyConUnique 4
1674 byteArrayPrimTyConKey = mkPreludeTyConUnique 5
1675 charPrimTyConKey = mkPreludeTyConUnique 7
1676 charTyConKey = mkPreludeTyConUnique 8
1677 doublePrimTyConKey = mkPreludeTyConUnique 9
1678 doubleTyConKey = mkPreludeTyConUnique 10
1679 floatPrimTyConKey = mkPreludeTyConUnique 11
1680 floatTyConKey = mkPreludeTyConUnique 12
1681 funTyConKey = mkPreludeTyConUnique 13
1682 intPrimTyConKey = mkPreludeTyConUnique 14
1683 intTyConKey = mkPreludeTyConUnique 15
1684 int8PrimTyConKey = mkPreludeTyConUnique 16
1685 int8TyConKey = mkPreludeTyConUnique 17
1686 int16PrimTyConKey = mkPreludeTyConUnique 18
1687 int16TyConKey = mkPreludeTyConUnique 19
1688 int32PrimTyConKey = mkPreludeTyConUnique 20
1689 int32TyConKey = mkPreludeTyConUnique 21
1690 int64PrimTyConKey = mkPreludeTyConUnique 22
1691 int64TyConKey = mkPreludeTyConUnique 23
1692 integerTyConKey = mkPreludeTyConUnique 24
1693 naturalTyConKey = mkPreludeTyConUnique 25
1694
1695 listTyConKey = mkPreludeTyConUnique 26
1696 foreignObjPrimTyConKey = mkPreludeTyConUnique 27
1697 maybeTyConKey = mkPreludeTyConUnique 28
1698 weakPrimTyConKey = mkPreludeTyConUnique 29
1699 mutableArrayPrimTyConKey = mkPreludeTyConUnique 30
1700 mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 31
1701 orderingTyConKey = mkPreludeTyConUnique 32
1702 mVarPrimTyConKey = mkPreludeTyConUnique 33
1703 ratioTyConKey = mkPreludeTyConUnique 34
1704 rationalTyConKey = mkPreludeTyConUnique 35
1705 realWorldTyConKey = mkPreludeTyConUnique 36
1706 stablePtrPrimTyConKey = mkPreludeTyConUnique 37
1707 stablePtrTyConKey = mkPreludeTyConUnique 38
1708 eqTyConKey = mkPreludeTyConUnique 40
1709 heqTyConKey = mkPreludeTyConUnique 41
1710 arrayArrayPrimTyConKey = mkPreludeTyConUnique 42
1711 mutableArrayArrayPrimTyConKey = mkPreludeTyConUnique 43
1712
1713 statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey,
1714 mutVarPrimTyConKey, ioTyConKey,
1715 wordPrimTyConKey, wordTyConKey, word8PrimTyConKey, word8TyConKey,
1716 word16PrimTyConKey, word16TyConKey, word32PrimTyConKey, word32TyConKey,
1717 word64PrimTyConKey, word64TyConKey,
1718 liftedConKey, unliftedConKey, anyBoxConKey, kindConKey, boxityConKey,
1719 typeConKey, threadIdPrimTyConKey, bcoPrimTyConKey, ptrTyConKey,
1720 funPtrTyConKey, tVarPrimTyConKey, eqPrimTyConKey,
1721 eqReprPrimTyConKey, eqPhantPrimTyConKey, voidPrimTyConKey,
1722 compactPrimTyConKey :: Unique
1723 statePrimTyConKey = mkPreludeTyConUnique 50
1724 stableNamePrimTyConKey = mkPreludeTyConUnique 51
1725 stableNameTyConKey = mkPreludeTyConUnique 52
1726 eqPrimTyConKey = mkPreludeTyConUnique 53
1727 eqReprPrimTyConKey = mkPreludeTyConUnique 54
1728 eqPhantPrimTyConKey = mkPreludeTyConUnique 55
1729 mutVarPrimTyConKey = mkPreludeTyConUnique 56
1730 ioTyConKey = mkPreludeTyConUnique 57
1731 voidPrimTyConKey = mkPreludeTyConUnique 58
1732 wordPrimTyConKey = mkPreludeTyConUnique 59
1733 wordTyConKey = mkPreludeTyConUnique 60
1734 word8PrimTyConKey = mkPreludeTyConUnique 61
1735 word8TyConKey = mkPreludeTyConUnique 62
1736 word16PrimTyConKey = mkPreludeTyConUnique 63
1737 word16TyConKey = mkPreludeTyConUnique 64
1738 word32PrimTyConKey = mkPreludeTyConUnique 65
1739 word32TyConKey = mkPreludeTyConUnique 66
1740 word64PrimTyConKey = mkPreludeTyConUnique 67
1741 word64TyConKey = mkPreludeTyConUnique 68
1742 liftedConKey = mkPreludeTyConUnique 69
1743 unliftedConKey = mkPreludeTyConUnique 70
1744 anyBoxConKey = mkPreludeTyConUnique 71
1745 kindConKey = mkPreludeTyConUnique 72
1746 boxityConKey = mkPreludeTyConUnique 73
1747 typeConKey = mkPreludeTyConUnique 74
1748 threadIdPrimTyConKey = mkPreludeTyConUnique 75
1749 bcoPrimTyConKey = mkPreludeTyConUnique 76
1750 ptrTyConKey = mkPreludeTyConUnique 77
1751 funPtrTyConKey = mkPreludeTyConUnique 78
1752 tVarPrimTyConKey = mkPreludeTyConUnique 79
1753 compactPrimTyConKey = mkPreludeTyConUnique 80
1754
1755 -- dotnet interop
1756 objectTyConKey :: Unique
1757 objectTyConKey = mkPreludeTyConUnique 83
1758
1759 eitherTyConKey :: Unique
1760 eitherTyConKey = mkPreludeTyConUnique 84
1761
1762 -- Kind constructors
1763 liftedTypeKindTyConKey, tYPETyConKey,
1764 constraintKindTyConKey, runtimeRepTyConKey,
1765 vecCountTyConKey, vecElemTyConKey :: Unique
1766 liftedTypeKindTyConKey = mkPreludeTyConUnique 87
1767 tYPETyConKey = mkPreludeTyConUnique 88
1768 constraintKindTyConKey = mkPreludeTyConUnique 92
1769 runtimeRepTyConKey = mkPreludeTyConUnique 95
1770 vecCountTyConKey = mkPreludeTyConUnique 96
1771 vecElemTyConKey = mkPreludeTyConUnique 97
1772
1773 pluginTyConKey, frontendPluginTyConKey :: Unique
1774 pluginTyConKey = mkPreludeTyConUnique 102
1775 frontendPluginTyConKey = mkPreludeTyConUnique 103
1776
1777 unknownTyConKey, unknown1TyConKey, unknown2TyConKey, unknown3TyConKey,
1778 opaqueTyConKey :: Unique
1779 unknownTyConKey = mkPreludeTyConUnique 129
1780 unknown1TyConKey = mkPreludeTyConUnique 130
1781 unknown2TyConKey = mkPreludeTyConUnique 131
1782 unknown3TyConKey = mkPreludeTyConUnique 132
1783 opaqueTyConKey = mkPreludeTyConUnique 133
1784
1785 -- Generics (Unique keys)
1786 v1TyConKey, u1TyConKey, par1TyConKey, rec1TyConKey,
1787 k1TyConKey, m1TyConKey, sumTyConKey, prodTyConKey,
1788 compTyConKey, rTyConKey, dTyConKey,
1789 cTyConKey, sTyConKey, rec0TyConKey,
1790 d1TyConKey, c1TyConKey, s1TyConKey, noSelTyConKey,
1791 repTyConKey, rep1TyConKey, uRecTyConKey,
1792 uAddrTyConKey, uCharTyConKey, uDoubleTyConKey,
1793 uFloatTyConKey, uIntTyConKey, uWordTyConKey :: Unique
1794
1795 v1TyConKey = mkPreludeTyConUnique 135
1796 u1TyConKey = mkPreludeTyConUnique 136
1797 par1TyConKey = mkPreludeTyConUnique 137
1798 rec1TyConKey = mkPreludeTyConUnique 138
1799 k1TyConKey = mkPreludeTyConUnique 139
1800 m1TyConKey = mkPreludeTyConUnique 140
1801
1802 sumTyConKey = mkPreludeTyConUnique 141
1803 prodTyConKey = mkPreludeTyConUnique 142
1804 compTyConKey = mkPreludeTyConUnique 143
1805
1806 rTyConKey = mkPreludeTyConUnique 144
1807 dTyConKey = mkPreludeTyConUnique 146
1808 cTyConKey = mkPreludeTyConUnique 147
1809 sTyConKey = mkPreludeTyConUnique 148
1810
1811 rec0TyConKey = mkPreludeTyConUnique 149
1812 d1TyConKey = mkPreludeTyConUnique 151
1813 c1TyConKey = mkPreludeTyConUnique 152
1814 s1TyConKey = mkPreludeTyConUnique 153
1815 noSelTyConKey = mkPreludeTyConUnique 154
1816
1817 repTyConKey = mkPreludeTyConUnique 155
1818 rep1TyConKey = mkPreludeTyConUnique 156
1819
1820 uRecTyConKey = mkPreludeTyConUnique 157
1821 uAddrTyConKey = mkPreludeTyConUnique 158
1822 uCharTyConKey = mkPreludeTyConUnique 159
1823 uDoubleTyConKey = mkPreludeTyConUnique 160
1824 uFloatTyConKey = mkPreludeTyConUnique 161
1825 uIntTyConKey = mkPreludeTyConUnique 162
1826 uWordTyConKey = mkPreludeTyConUnique 163
1827
1828 -- Type-level naturals
1829 typeNatKindConNameKey, typeSymbolKindConNameKey,
1830 typeNatAddTyFamNameKey, typeNatMulTyFamNameKey, typeNatExpTyFamNameKey,
1831 typeNatLeqTyFamNameKey, typeNatSubTyFamNameKey
1832 , typeSymbolCmpTyFamNameKey, typeNatCmpTyFamNameKey
1833 , typeNatDivTyFamNameKey
1834 , typeNatModTyFamNameKey
1835 , typeNatLogTyFamNameKey
1836 :: Unique
1837 typeNatKindConNameKey = mkPreludeTyConUnique 164
1838 typeSymbolKindConNameKey = mkPreludeTyConUnique 165
1839 typeNatAddTyFamNameKey = mkPreludeTyConUnique 166
1840 typeNatMulTyFamNameKey = mkPreludeTyConUnique 167
1841 typeNatExpTyFamNameKey = mkPreludeTyConUnique 168
1842 typeNatLeqTyFamNameKey = mkPreludeTyConUnique 169
1843 typeNatSubTyFamNameKey = mkPreludeTyConUnique 170
1844 typeSymbolCmpTyFamNameKey = mkPreludeTyConUnique 171
1845 typeNatCmpTyFamNameKey = mkPreludeTyConUnique 172
1846 typeNatDivTyFamNameKey = mkPreludeTyConUnique 173
1847 typeNatModTyFamNameKey = mkPreludeTyConUnique 174
1848 typeNatLogTyFamNameKey = mkPreludeTyConUnique 175
1849
1850 -- Custom user type-errors
1851 errorMessageTypeErrorFamKey :: Unique
1852 errorMessageTypeErrorFamKey = mkPreludeTyConUnique 176
1853
1854
1855
1856 ntTyConKey:: Unique
1857 ntTyConKey = mkPreludeTyConUnique 177
1858 coercibleTyConKey :: Unique
1859 coercibleTyConKey = mkPreludeTyConUnique 178
1860
1861 proxyPrimTyConKey :: Unique
1862 proxyPrimTyConKey = mkPreludeTyConUnique 179
1863
1864 specTyConKey :: Unique
1865 specTyConKey = mkPreludeTyConUnique 180
1866
1867 anyTyConKey :: Unique
1868 anyTyConKey = mkPreludeTyConUnique 181
1869
1870 smallArrayPrimTyConKey = mkPreludeTyConUnique 182
1871 smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 183
1872
1873 staticPtrTyConKey :: Unique
1874 staticPtrTyConKey = mkPreludeTyConUnique 184
1875
1876 staticPtrInfoTyConKey :: Unique
1877 staticPtrInfoTyConKey = mkPreludeTyConUnique 185
1878
1879 callStackTyConKey :: Unique
1880 callStackTyConKey = mkPreludeTyConUnique 186
1881
1882 -- Typeables
1883 typeRepTyConKey, someTypeRepTyConKey, someTypeRepDataConKey :: Unique
1884 typeRepTyConKey = mkPreludeTyConUnique 187
1885 someTypeRepTyConKey = mkPreludeTyConUnique 188
1886 someTypeRepDataConKey = mkPreludeTyConUnique 189
1887
1888
1889 typeSymbolAppendFamNameKey :: Unique
1890 typeSymbolAppendFamNameKey = mkPreludeTyConUnique 190
1891
1892 ---------------- Template Haskell -------------------
1893 -- THNames.hs: USES TyConUniques 200-299
1894 -----------------------------------------------------
1895
1896 ----------------------- SIMD ------------------------
1897 -- USES TyConUniques 300-399
1898 -----------------------------------------------------
1899
1900 #include "primop-vector-uniques.hs-incl"
1901
1902 {-
1903 ************************************************************************
1904 * *
1905 \subsubsection[Uniques-prelude-DataCons]{@Uniques@ for wired-in @DataCons@}
1906 * *
1907 ************************************************************************
1908 -}
1909
1910 charDataConKey, consDataConKey, doubleDataConKey, falseDataConKey,
1911 floatDataConKey, intDataConKey, integerSDataConKey, nilDataConKey,
1912 ratioDataConKey, stableNameDataConKey, trueDataConKey, wordDataConKey,
1913 word8DataConKey, ioDataConKey, integerDataConKey, heqDataConKey,
1914 coercibleDataConKey, eqDataConKey, nothingDataConKey, justDataConKey :: Unique
1915
1916 charDataConKey = mkPreludeDataConUnique 1
1917 consDataConKey = mkPreludeDataConUnique 2
1918 doubleDataConKey = mkPreludeDataConUnique 3
1919 falseDataConKey = mkPreludeDataConUnique 4
1920 floatDataConKey = mkPreludeDataConUnique 5
1921 intDataConKey = mkPreludeDataConUnique 6
1922 integerSDataConKey = mkPreludeDataConUnique 7
1923 nothingDataConKey = mkPreludeDataConUnique 8
1924 justDataConKey = mkPreludeDataConUnique 9
1925 eqDataConKey = mkPreludeDataConUnique 10
1926 nilDataConKey = mkPreludeDataConUnique 11
1927 ratioDataConKey = mkPreludeDataConUnique 12
1928 word8DataConKey = mkPreludeDataConUnique 13
1929 stableNameDataConKey = mkPreludeDataConUnique 14
1930 trueDataConKey = mkPreludeDataConUnique 15
1931 wordDataConKey = mkPreludeDataConUnique 16
1932 ioDataConKey = mkPreludeDataConUnique 17
1933 integerDataConKey = mkPreludeDataConUnique 18
1934 heqDataConKey = mkPreludeDataConUnique 19
1935
1936 -- Generic data constructors
1937 crossDataConKey, inlDataConKey, inrDataConKey, genUnitDataConKey :: Unique
1938 crossDataConKey = mkPreludeDataConUnique 20
1939 inlDataConKey = mkPreludeDataConUnique 21
1940 inrDataConKey = mkPreludeDataConUnique 22
1941 genUnitDataConKey = mkPreludeDataConUnique 23
1942
1943 leftDataConKey, rightDataConKey :: Unique
1944 leftDataConKey = mkPreludeDataConUnique 25
1945 rightDataConKey = mkPreludeDataConUnique 26
1946
1947 ordLTDataConKey, ordEQDataConKey, ordGTDataConKey :: Unique
1948 ordLTDataConKey = mkPreludeDataConUnique 27
1949 ordEQDataConKey = mkPreludeDataConUnique 28
1950 ordGTDataConKey = mkPreludeDataConUnique 29
1951
1952
1953 coercibleDataConKey = mkPreludeDataConUnique 32
1954
1955 staticPtrDataConKey :: Unique
1956 staticPtrDataConKey = mkPreludeDataConUnique 33
1957
1958 staticPtrInfoDataConKey :: Unique
1959 staticPtrInfoDataConKey = mkPreludeDataConUnique 34
1960
1961 fingerprintDataConKey :: Unique
1962 fingerprintDataConKey = mkPreludeDataConUnique 35
1963
1964 srcLocDataConKey :: Unique
1965 srcLocDataConKey = mkPreludeDataConUnique 37
1966
1967 trTyConTyConKey, trTyConDataConKey,
1968 trModuleTyConKey, trModuleDataConKey,
1969 trNameTyConKey, trNameSDataConKey, trNameDDataConKey,
1970 trGhcPrimModuleKey, kindRepTyConKey,
1971 typeLitSortTyConKey :: Unique
1972 trTyConTyConKey = mkPreludeDataConUnique 40
1973 trTyConDataConKey = mkPreludeDataConUnique 41
1974 trModuleTyConKey = mkPreludeDataConUnique 42
1975 trModuleDataConKey = mkPreludeDataConUnique 43
1976 trNameTyConKey = mkPreludeDataConUnique 44
1977 trNameSDataConKey = mkPreludeDataConUnique 45
1978 trNameDDataConKey = mkPreludeDataConUnique 46
1979 trGhcPrimModuleKey = mkPreludeDataConUnique 47
1980 kindRepTyConKey = mkPreludeDataConUnique 48
1981 typeLitSortTyConKey = mkPreludeDataConUnique 49
1982
1983 typeErrorTextDataConKey,
1984 typeErrorAppendDataConKey,
1985 typeErrorVAppendDataConKey,
1986 typeErrorShowTypeDataConKey
1987 :: Unique
1988 typeErrorTextDataConKey = mkPreludeDataConUnique 50
1989 typeErrorAppendDataConKey = mkPreludeDataConUnique 51
1990 typeErrorVAppendDataConKey = mkPreludeDataConUnique 52
1991 typeErrorShowTypeDataConKey = mkPreludeDataConUnique 53
1992
1993 prefixIDataConKey, infixIDataConKey, leftAssociativeDataConKey,
1994 rightAssociativeDataConKey, notAssociativeDataConKey,
1995 sourceUnpackDataConKey, sourceNoUnpackDataConKey,
1996 noSourceUnpackednessDataConKey, sourceLazyDataConKey,
1997 sourceStrictDataConKey, noSourceStrictnessDataConKey,
1998 decidedLazyDataConKey, decidedStrictDataConKey, decidedUnpackDataConKey,
1999 metaDataDataConKey, metaConsDataConKey, metaSelDataConKey :: Unique
2000 prefixIDataConKey = mkPreludeDataConUnique 54
2001 infixIDataConKey = mkPreludeDataConUnique 55
2002 leftAssociativeDataConKey = mkPreludeDataConUnique 56
2003 rightAssociativeDataConKey = mkPreludeDataConUnique 57
2004 notAssociativeDataConKey = mkPreludeDataConUnique 58
2005 sourceUnpackDataConKey = mkPreludeDataConUnique 59
2006 sourceNoUnpackDataConKey = mkPreludeDataConUnique 60
2007 noSourceUnpackednessDataConKey = mkPreludeDataConUnique 61
2008 sourceLazyDataConKey = mkPreludeDataConUnique 62
2009 sourceStrictDataConKey = mkPreludeDataConUnique 63
2010 noSourceStrictnessDataConKey = mkPreludeDataConUnique 64
2011 decidedLazyDataConKey = mkPreludeDataConUnique 65
2012 decidedStrictDataConKey = mkPreludeDataConUnique 66
2013 decidedUnpackDataConKey = mkPreludeDataConUnique 67
2014 metaDataDataConKey = mkPreludeDataConUnique 68
2015 metaConsDataConKey = mkPreludeDataConUnique 69
2016 metaSelDataConKey = mkPreludeDataConUnique 70
2017
2018 vecRepDataConKey, tupleRepDataConKey, sumRepDataConKey :: Unique
2019 vecRepDataConKey = mkPreludeDataConUnique 71
2020 tupleRepDataConKey = mkPreludeDataConUnique 72
2021 sumRepDataConKey = mkPreludeDataConUnique 73
2022
2023 -- See Note [Wiring in RuntimeRep] in TysWiredIn
2024 runtimeRepSimpleDataConKeys, unliftedSimpleRepDataConKeys, unliftedRepDataConKeys :: [Unique]
2025 liftedRepDataConKey :: Unique
2026 runtimeRepSimpleDataConKeys@(liftedRepDataConKey : unliftedSimpleRepDataConKeys)
2027 = map mkPreludeDataConUnique [74..88]
2028
2029 unliftedRepDataConKeys = vecRepDataConKey :
2030 tupleRepDataConKey :
2031 sumRepDataConKey :
2032 unliftedSimpleRepDataConKeys
2033
2034 -- See Note [Wiring in RuntimeRep] in TysWiredIn
2035 -- VecCount
2036 vecCountDataConKeys :: [Unique]
2037 vecCountDataConKeys = map mkPreludeDataConUnique [89..94]
2038
2039 -- See Note [Wiring in RuntimeRep] in TysWiredIn
2040 -- VecElem
2041 vecElemDataConKeys :: [Unique]
2042 vecElemDataConKeys = map mkPreludeDataConUnique [95..104]
2043
2044 -- Typeable things
2045 kindRepTyConAppDataConKey, kindRepVarDataConKey, kindRepAppDataConKey,
2046 kindRepFunDataConKey, kindRepTYPEDataConKey,
2047 kindRepTypeLitSDataConKey, kindRepTypeLitDDataConKey
2048 :: Unique
2049 kindRepTyConAppDataConKey = mkPreludeDataConUnique 105
2050 kindRepVarDataConKey = mkPreludeDataConUnique 106
2051 kindRepAppDataConKey = mkPreludeDataConUnique 107
2052 kindRepFunDataConKey = mkPreludeDataConUnique 108
2053 kindRepTYPEDataConKey = mkPreludeDataConUnique 109
2054 kindRepTypeLitSDataConKey = mkPreludeDataConUnique 110
2055 kindRepTypeLitDDataConKey = mkPreludeDataConUnique 111
2056
2057 typeLitSymbolDataConKey, typeLitNatDataConKey :: Unique
2058 typeLitSymbolDataConKey = mkPreludeDataConUnique 112
2059 typeLitNatDataConKey = mkPreludeDataConUnique 113
2060
2061
2062 ---------------- Template Haskell -------------------
2063 -- THNames.hs: USES DataUniques 200-250
2064 -----------------------------------------------------
2065
2066
2067 {-
2068 ************************************************************************
2069 * *
2070 \subsubsection[Uniques-prelude-Ids]{@Uniques@ for wired-in @Ids@ (except @DataCons@)}
2071 * *
2072 ************************************************************************
2073 -}
2074
2075 wildCardKey, absentErrorIdKey, augmentIdKey, appendIdKey,
2076 buildIdKey, errorIdKey, foldrIdKey, recSelErrorIdKey,
2077 seqIdKey, eqStringIdKey,
2078 noMethodBindingErrorIdKey, nonExhaustiveGuardsErrorIdKey,
2079 runtimeErrorIdKey, patErrorIdKey, voidPrimIdKey,
2080 realWorldPrimIdKey, recConErrorIdKey,
2081 unpackCStringUtf8IdKey, unpackCStringAppendIdKey,
2082 unpackCStringFoldrIdKey, unpackCStringIdKey,
2083 typeErrorIdKey, divIntIdKey, modIntIdKey,
2084 absentSumFieldErrorIdKey :: Unique
2085
2086 wildCardKey = mkPreludeMiscIdUnique 0 -- See Note [WildCard binders]
2087 absentErrorIdKey = mkPreludeMiscIdUnique 1
2088 augmentIdKey = mkPreludeMiscIdUnique 2
2089 appendIdKey = mkPreludeMiscIdUnique 3
2090 buildIdKey = mkPreludeMiscIdUnique 4
2091 errorIdKey = mkPreludeMiscIdUnique 5
2092 foldrIdKey = mkPreludeMiscIdUnique 6
2093 recSelErrorIdKey = mkPreludeMiscIdUnique 7
2094 seqIdKey = mkPreludeMiscIdUnique 8
2095 eqStringIdKey = mkPreludeMiscIdUnique 10
2096 noMethodBindingErrorIdKey = mkPreludeMiscIdUnique 11
2097 nonExhaustiveGuardsErrorIdKey = mkPreludeMiscIdUnique 12
2098 runtimeErrorIdKey = mkPreludeMiscIdUnique 13
2099 patErrorIdKey = mkPreludeMiscIdUnique 14
2100 realWorldPrimIdKey = mkPreludeMiscIdUnique 15
2101 recConErrorIdKey = mkPreludeMiscIdUnique 16
2102 unpackCStringUtf8IdKey = mkPreludeMiscIdUnique 17
2103 unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18
2104 unpackCStringFoldrIdKey = mkPreludeMiscIdUnique 19
2105 unpackCStringIdKey = mkPreludeMiscIdUnique 20
2106 voidPrimIdKey = mkPreludeMiscIdUnique 21
2107 typeErrorIdKey = mkPreludeMiscIdUnique 22
2108 divIntIdKey = mkPreludeMiscIdUnique 23
2109 modIntIdKey = mkPreludeMiscIdUnique 24
2110 absentSumFieldErrorIdKey = mkPreludeMiscIdUnique 9
2111
2112 unsafeCoerceIdKey, concatIdKey, filterIdKey, zipIdKey, bindIOIdKey,
2113 returnIOIdKey, newStablePtrIdKey,
2114 printIdKey, failIOIdKey, nullAddrIdKey, voidArgIdKey,
2115 fstIdKey, sndIdKey, otherwiseIdKey, assertIdKey :: Unique
2116 unsafeCoerceIdKey = mkPreludeMiscIdUnique 30
2117 concatIdKey = mkPreludeMiscIdUnique 31
2118 filterIdKey = mkPreludeMiscIdUnique 32
2119 zipIdKey = mkPreludeMiscIdUnique 33
2120 bindIOIdKey = mkPreludeMiscIdUnique 34
2121 returnIOIdKey = mkPreludeMiscIdUnique 35
2122 newStablePtrIdKey = mkPreludeMiscIdUnique 36
2123 printIdKey = mkPreludeMiscIdUnique 37
2124 failIOIdKey = mkPreludeMiscIdUnique 38
2125 nullAddrIdKey = mkPreludeMiscIdUnique 39
2126 voidArgIdKey = mkPreludeMiscIdUnique 40
2127 fstIdKey = mkPreludeMiscIdUnique 41
2128 sndIdKey = mkPreludeMiscIdUnique 42
2129 otherwiseIdKey = mkPreludeMiscIdUnique 43
2130 assertIdKey = mkPreludeMiscIdUnique 44
2131
2132 mkIntegerIdKey, smallIntegerIdKey, wordToIntegerIdKey,
2133 integerToWordIdKey, integerToIntIdKey,
2134 integerToWord64IdKey, integerToInt64IdKey,
2135 word64ToIntegerIdKey, int64ToIntegerIdKey,
2136 plusIntegerIdKey, timesIntegerIdKey, minusIntegerIdKey,
2137 negateIntegerIdKey,
2138 eqIntegerPrimIdKey, neqIntegerPrimIdKey, absIntegerIdKey, signumIntegerIdKey,
2139 leIntegerPrimIdKey, gtIntegerPrimIdKey, ltIntegerPrimIdKey, geIntegerPrimIdKey,
2140 compareIntegerIdKey, quotRemIntegerIdKey, divModIntegerIdKey,
2141 quotIntegerIdKey, remIntegerIdKey, divIntegerIdKey, modIntegerIdKey,
2142 floatFromIntegerIdKey, doubleFromIntegerIdKey,
2143 encodeFloatIntegerIdKey, encodeDoubleIntegerIdKey,
2144 decodeDoubleIntegerIdKey,
2145 gcdIntegerIdKey, lcmIntegerIdKey,
2146 andIntegerIdKey, orIntegerIdKey, xorIntegerIdKey, complementIntegerIdKey,
2147 shiftLIntegerIdKey, shiftRIntegerIdKey :: Unique
2148 mkIntegerIdKey = mkPreludeMiscIdUnique 60
2149 smallIntegerIdKey = mkPreludeMiscIdUnique 61
2150 integerToWordIdKey = mkPreludeMiscIdUnique 62
2151 integerToIntIdKey = mkPreludeMiscIdUnique 63
2152 integerToWord64IdKey = mkPreludeMiscIdUnique 64
2153 integerToInt64IdKey = mkPreludeMiscIdUnique 65
2154 plusIntegerIdKey = mkPreludeMiscIdUnique 66
2155 timesIntegerIdKey = mkPreludeMiscIdUnique 67
2156 minusIntegerIdKey = mkPreludeMiscIdUnique 68
2157 negateIntegerIdKey = mkPreludeMiscIdUnique 69
2158 eqIntegerPrimIdKey = mkPreludeMiscIdUnique 70
2159 neqIntegerPrimIdKey = mkPreludeMiscIdUnique 71
2160 absIntegerIdKey = mkPreludeMiscIdUnique 72
2161 signumIntegerIdKey = mkPreludeMiscIdUnique 73
2162 leIntegerPrimIdKey = mkPreludeMiscIdUnique 74
2163 gtIntegerPrimIdKey = mkPreludeMiscIdUnique 75
2164 ltIntegerPrimIdKey = mkPreludeMiscIdUnique 76
2165 geIntegerPrimIdKey = mkPreludeMiscIdUnique 77
2166 compareIntegerIdKey = mkPreludeMiscIdUnique 78
2167 quotIntegerIdKey = mkPreludeMiscIdUnique 79
2168 remIntegerIdKey = mkPreludeMiscIdUnique 80
2169 divIntegerIdKey = mkPreludeMiscIdUnique 81
2170 modIntegerIdKey = mkPreludeMiscIdUnique 82
2171 divModIntegerIdKey = mkPreludeMiscIdUnique 83
2172 quotRemIntegerIdKey = mkPreludeMiscIdUnique 84
2173 floatFromIntegerIdKey = mkPreludeMiscIdUnique 85
2174 doubleFromIntegerIdKey = mkPreludeMiscIdUnique 86
2175 encodeFloatIntegerIdKey = mkPreludeMiscIdUnique 87
2176 encodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 88
2177 gcdIntegerIdKey = mkPreludeMiscIdUnique 89
2178 lcmIntegerIdKey = mkPreludeMiscIdUnique 90
2179 andIntegerIdKey = mkPreludeMiscIdUnique 91
2180 orIntegerIdKey = mkPreludeMiscIdUnique 92
2181 xorIntegerIdKey = mkPreludeMiscIdUnique 93
2182 complementIntegerIdKey = mkPreludeMiscIdUnique 94
2183 shiftLIntegerIdKey = mkPreludeMiscIdUnique 95
2184 shiftRIntegerIdKey = mkPreludeMiscIdUnique 96
2185 wordToIntegerIdKey = mkPreludeMiscIdUnique 97
2186 word64ToIntegerIdKey = mkPreludeMiscIdUnique 98
2187 int64ToIntegerIdKey = mkPreludeMiscIdUnique 99
2188 decodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 100
2189
2190 rootMainKey, runMainKey :: Unique
2191 rootMainKey = mkPreludeMiscIdUnique 101
2192 runMainKey = mkPreludeMiscIdUnique 102
2193
2194 thenIOIdKey, lazyIdKey, assertErrorIdKey, oneShotKey, runRWKey :: Unique
2195 thenIOIdKey = mkPreludeMiscIdUnique 103
2196 lazyIdKey = mkPreludeMiscIdUnique 104
2197 assertErrorIdKey = mkPreludeMiscIdUnique 105
2198 oneShotKey = mkPreludeMiscIdUnique 106
2199 runRWKey = mkPreludeMiscIdUnique 107
2200
2201 traceKey :: Unique
2202 traceKey = mkPreludeMiscIdUnique 108
2203
2204 breakpointIdKey, breakpointCondIdKey :: Unique
2205 breakpointIdKey = mkPreludeMiscIdUnique 110
2206 breakpointCondIdKey = mkPreludeMiscIdUnique 111
2207
2208 inlineIdKey, noinlineIdKey :: Unique
2209 inlineIdKey = mkPreludeMiscIdUnique 120
2210 -- see below
2211
2212 mapIdKey, groupWithIdKey, dollarIdKey :: Unique
2213 mapIdKey = mkPreludeMiscIdUnique 121
2214 groupWithIdKey = mkPreludeMiscIdUnique 122
2215 dollarIdKey = mkPreludeMiscIdUnique 123
2216
2217 coercionTokenIdKey :: Unique
2218 coercionTokenIdKey = mkPreludeMiscIdUnique 124
2219
2220 noinlineIdKey = mkPreludeMiscIdUnique 125
2221
2222 rationalToFloatIdKey, rationalToDoubleIdKey :: Unique
2223 rationalToFloatIdKey = mkPreludeMiscIdUnique 130
2224 rationalToDoubleIdKey = mkPreludeMiscIdUnique 131
2225
2226 -- dotnet interop
2227 unmarshalObjectIdKey, marshalObjectIdKey, marshalStringIdKey,
2228 unmarshalStringIdKey, checkDotnetResNameIdKey :: Unique
2229 unmarshalObjectIdKey = mkPreludeMiscIdUnique 150
2230 marshalObjectIdKey = mkPreludeMiscIdUnique 151
2231 marshalStringIdKey = mkPreludeMiscIdUnique 152
2232 unmarshalStringIdKey = mkPreludeMiscIdUnique 153
2233 checkDotnetResNameIdKey = mkPreludeMiscIdUnique 154
2234
2235 undefinedKey :: Unique
2236 undefinedKey = mkPreludeMiscIdUnique 155
2237
2238 magicDictKey :: Unique
2239 magicDictKey = mkPreludeMiscIdUnique 156
2240
2241 coerceKey :: Unique
2242 coerceKey = mkPreludeMiscIdUnique 157
2243
2244 {-
2245 Certain class operations from Prelude classes. They get their own
2246 uniques so we can look them up easily when we want to conjure them up
2247 during type checking.
2248 -}
2249
2250 -- Just a placeholder for unbound variables produced by the renamer:
2251 unboundKey :: Unique
2252 unboundKey = mkPreludeMiscIdUnique 158
2253
2254 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey,
2255 enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey,
2256 enumFromThenToClassOpKey, eqClassOpKey, geClassOpKey, negateClassOpKey,
2257 bindMClassOpKey, thenMClassOpKey, returnMClassOpKey, fmapClassOpKey
2258 :: Unique
2259 fromIntegerClassOpKey = mkPreludeMiscIdUnique 160
2260 minusClassOpKey = mkPreludeMiscIdUnique 161
2261 fromRationalClassOpKey = mkPreludeMiscIdUnique 162
2262 enumFromClassOpKey = mkPreludeMiscIdUnique 163
2263 enumFromThenClassOpKey = mkPreludeMiscIdUnique 164
2264 enumFromToClassOpKey = mkPreludeMiscIdUnique 165
2265 enumFromThenToClassOpKey = mkPreludeMiscIdUnique 166
2266 eqClassOpKey = mkPreludeMiscIdUnique 167
2267 geClassOpKey = mkPreludeMiscIdUnique 168
2268 negateClassOpKey = mkPreludeMiscIdUnique 169
2269 bindMClassOpKey = mkPreludeMiscIdUnique 171 -- (>>=)
2270 thenMClassOpKey = mkPreludeMiscIdUnique 172 -- (>>)
2271 fmapClassOpKey = mkPreludeMiscIdUnique 173
2272 returnMClassOpKey = mkPreludeMiscIdUnique 174
2273
2274 -- Recursive do notation
2275 mfixIdKey :: Unique
2276 mfixIdKey = mkPreludeMiscIdUnique 175
2277
2278 -- MonadFail operations
2279 failMClassOpKey :: Unique
2280 failMClassOpKey = mkPreludeMiscIdUnique 176
2281
2282 -- Arrow notation
2283 arrAIdKey, composeAIdKey, firstAIdKey, appAIdKey, choiceAIdKey,
2284 loopAIdKey :: Unique
2285 arrAIdKey = mkPreludeMiscIdUnique 180
2286 composeAIdKey = mkPreludeMiscIdUnique 181 -- >>>
2287 firstAIdKey = mkPreludeMiscIdUnique 182
2288 appAIdKey = mkPreludeMiscIdUnique 183
2289 choiceAIdKey = mkPreludeMiscIdUnique 184 -- |||
2290 loopAIdKey = mkPreludeMiscIdUnique 185
2291
2292 fromStringClassOpKey :: Unique
2293 fromStringClassOpKey = mkPreludeMiscIdUnique 186
2294
2295 -- Annotation type checking
2296 toAnnotationWrapperIdKey :: Unique
2297 toAnnotationWrapperIdKey = mkPreludeMiscIdUnique 187
2298
2299 -- Conversion functions
2300 fromIntegralIdKey, realToFracIdKey, toIntegerClassOpKey, toRationalClassOpKey :: Unique
2301 fromIntegralIdKey = mkPreludeMiscIdUnique 190
2302 realToFracIdKey = mkPreludeMiscIdUnique 191
2303 toIntegerClassOpKey = mkPreludeMiscIdUnique 192
2304 toRationalClassOpKey = mkPreludeMiscIdUnique 193
2305
2306 -- Monad comprehensions
2307 guardMIdKey, liftMIdKey, mzipIdKey :: Unique
2308 guardMIdKey = mkPreludeMiscIdUnique 194
2309 liftMIdKey = mkPreludeMiscIdUnique 195
2310 mzipIdKey = mkPreludeMiscIdUnique 196
2311
2312 -- GHCi
2313 ghciStepIoMClassOpKey :: Unique
2314 ghciStepIoMClassOpKey = mkPreludeMiscIdUnique 197
2315
2316 -- Overloaded lists
2317 isListClassKey, fromListClassOpKey, fromListNClassOpKey, toListClassOpKey :: Unique
2318 isListClassKey = mkPreludeMiscIdUnique 198
2319 fromListClassOpKey = mkPreludeMiscIdUnique 199
2320 fromListNClassOpKey = mkPreludeMiscIdUnique 500
2321 toListClassOpKey = mkPreludeMiscIdUnique 501
2322
2323 proxyHashKey :: Unique
2324 proxyHashKey = mkPreludeMiscIdUnique 502
2325
2326 ---------------- Template Haskell -------------------
2327 -- THNames.hs: USES IdUniques 200-499
2328 -----------------------------------------------------
2329
2330 -- Used to make `Typeable` dictionaries
2331 mkTyConKey
2332 , mkTrTypeKey
2333 , mkTrConKey
2334 , mkTrAppKey
2335 , mkTrFunKey
2336 , typeNatTypeRepKey
2337 , typeSymbolTypeRepKey
2338 , typeRepIdKey
2339 :: Unique
2340 mkTyConKey = mkPreludeMiscIdUnique 503
2341 mkTrTypeKey = mkPreludeMiscIdUnique 504
2342 mkTrConKey = mkPreludeMiscIdUnique 505
2343 mkTrAppKey = mkPreludeMiscIdUnique 506
2344 typeNatTypeRepKey = mkPreludeMiscIdUnique 507
2345 typeSymbolTypeRepKey = mkPreludeMiscIdUnique 508
2346 typeRepIdKey = mkPreludeMiscIdUnique 509
2347 mkTrFunKey = mkPreludeMiscIdUnique 510
2348
2349 -- Representations for primitive types
2350 trTYPEKey
2351 ,trTYPE'PtrRepLiftedKey
2352 , trRuntimeRepKey
2353 , tr'PtrRepLiftedKey
2354 :: Unique
2355 trTYPEKey = mkPreludeMiscIdUnique 511
2356 trTYPE'PtrRepLiftedKey = mkPreludeMiscIdUnique 512
2357 trRuntimeRepKey = mkPreludeMiscIdUnique 513
2358 tr'PtrRepLiftedKey = mkPreludeMiscIdUnique 514
2359
2360 -- KindReps for common cases
2361 starKindRepKey, starArrStarKindRepKey, starArrStarArrStarKindRepKey :: Unique
2362 starKindRepKey = mkPreludeMiscIdUnique 520
2363 starArrStarKindRepKey = mkPreludeMiscIdUnique 521
2364 starArrStarArrStarKindRepKey = mkPreludeMiscIdUnique 522
2365
2366 -- Dynamic
2367 toDynIdKey :: Unique
2368 toDynIdKey = mkPreludeMiscIdUnique 523
2369
2370
2371 bitIntegerIdKey :: Unique
2372 bitIntegerIdKey = mkPreludeMiscIdUnique 550
2373
2374 heqSCSelIdKey, eqSCSelIdKey, coercibleSCSelIdKey :: Unique
2375 eqSCSelIdKey = mkPreludeMiscIdUnique 551
2376 heqSCSelIdKey = mkPreludeMiscIdUnique 552
2377 coercibleSCSelIdKey = mkPreludeMiscIdUnique 553
2378
2379 sappendClassOpKey :: Unique
2380 sappendClassOpKey = mkPreludeMiscIdUnique 554
2381
2382 memptyClassOpKey, mappendClassOpKey, mconcatClassOpKey :: Unique
2383 memptyClassOpKey = mkPreludeMiscIdUnique 555
2384 mappendClassOpKey = mkPreludeMiscIdUnique 556
2385 mconcatClassOpKey = mkPreludeMiscIdUnique 557
2386
2387 emptyCallStackKey, pushCallStackKey :: Unique
2388 emptyCallStackKey = mkPreludeMiscIdUnique 558
2389 pushCallStackKey = mkPreludeMiscIdUnique 559
2390
2391 fromStaticPtrClassOpKey :: Unique
2392 fromStaticPtrClassOpKey = mkPreludeMiscIdUnique 560
2393
2394 makeStaticKey :: Unique
2395 makeStaticKey = mkPreludeMiscIdUnique 561
2396
2397 -- Natural
2398 naturalFromIntegerIdKey, naturalToIntegerIdKey, plusNaturalIdKey,
2399 minusNaturalIdKey, timesNaturalIdKey, mkNaturalIdKey,
2400 naturalSDataConKey, wordToNaturalIdKey :: Unique
2401 naturalFromIntegerIdKey = mkPreludeMiscIdUnique 562
2402 naturalToIntegerIdKey = mkPreludeMiscIdUnique 563
2403 plusNaturalIdKey = mkPreludeMiscIdUnique 564
2404 minusNaturalIdKey = mkPreludeMiscIdUnique 565
2405 timesNaturalIdKey = mkPreludeMiscIdUnique 566
2406 mkNaturalIdKey = mkPreludeMiscIdUnique 567
2407 naturalSDataConKey = mkPreludeMiscIdUnique 568
2408 wordToNaturalIdKey = mkPreludeMiscIdUnique 569
2409
2410 {-
2411 ************************************************************************
2412 * *
2413 \subsection[Class-std-groups]{Standard groups of Prelude classes}
2414 * *
2415 ************************************************************************
2416
2417 NOTE: @Eq@ and @Text@ do need to appear in @standardClasses@
2418 even though every numeric class has these two as a superclass,
2419 because the list of ambiguous dictionaries hasn't been simplified.
2420 -}
2421
2422 numericClassKeys :: [Unique]
2423 numericClassKeys =
2424 [ numClassKey
2425 , realClassKey
2426 , integralClassKey
2427 ]
2428 ++ fractionalClassKeys
2429
2430 fractionalClassKeys :: [Unique]
2431 fractionalClassKeys =
2432 [ fractionalClassKey
2433 , floatingClassKey
2434 , realFracClassKey
2435 , realFloatClassKey
2436 ]
2437
2438 -- The "standard classes" are used in defaulting (Haskell 98 report 4.3.4),
2439 -- and are: "classes defined in the Prelude or a standard library"
2440 standardClassKeys :: [Unique]
2441 standardClassKeys = derivableClassKeys ++ numericClassKeys
2442 ++ [randomClassKey, randomGenClassKey,
2443 functorClassKey,
2444 monadClassKey, monadPlusClassKey, monadFailClassKey,
2445 semigroupClassKey, monoidClassKey,
2446 isStringClassKey,
2447 applicativeClassKey, foldableClassKey,
2448 traversableClassKey, alternativeClassKey
2449 ]
2450
2451 {-
2452 @derivableClassKeys@ is also used in checking \tr{deriving} constructs
2453 (@TcDeriv@).
2454 -}
2455
2456 derivableClassKeys :: [Unique]
2457 derivableClassKeys
2458 = [ eqClassKey, ordClassKey, enumClassKey, ixClassKey,
2459 boundedClassKey, showClassKey, readClassKey ]
2460
2461
2462 -- These are the "interactive classes" that are consulted when doing
2463 -- defaulting. Does not include Num or IsString, which have special
2464 -- handling.
2465 interactiveClassNames :: [Name]
2466 interactiveClassNames
2467 = [ showClassName, eqClassName, ordClassName, foldableClassName
2468 , traversableClassName ]
2469
2470 interactiveClassKeys :: [Unique]
2471 interactiveClassKeys = map getUnique interactiveClassNames
2472
2473 {-
2474 ************************************************************************
2475 * *
2476 Semi-builtin names
2477 * *
2478 ************************************************************************
2479
2480 The following names should be considered by GHCi to be in scope always.
2481
2482 -}
2483
2484 pretendNameIsInScope :: Name -> Bool
2485 pretendNameIsInScope n
2486 = any (n `hasKey`)
2487 [ liftedTypeKindTyConKey, tYPETyConKey
2488 , runtimeRepTyConKey, liftedRepDataConKey ]