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