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