'forall' always a keyword, plus the dot type operator
[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 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,
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 opaqueTyConName = tcQual gHC_BASE (fsLit "Opaque") opaqueTyConKey
1093 fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
1094
1095 -- PrelTup
1096 fstName, sndName :: Name
1097 fstName = varQual dATA_TUPLE (fsLit "fst") fstIdKey
1098 sndName = varQual dATA_TUPLE (fsLit "snd") sndIdKey
1099
1100 -- Module GHC.Num
1101 numClassName, fromIntegerName, minusName, negateName :: Name
1102 numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey
1103 fromIntegerName = varQual gHC_NUM (fsLit "fromInteger") fromIntegerClassOpKey
1104 minusName = varQual gHC_NUM (fsLit "-") minusClassOpKey
1105 negateName = varQual gHC_NUM (fsLit "negate") negateClassOpKey
1106
1107 integerTyConName, mkIntegerName, integerSDataConName,
1108 integerToWord64Name, integerToInt64Name,
1109 word64ToIntegerName, int64ToIntegerName,
1110 plusIntegerName, timesIntegerName, smallIntegerName,
1111 wordToIntegerName,
1112 integerToWordName, integerToIntName, minusIntegerName,
1113 negateIntegerName, eqIntegerPrimName, neqIntegerPrimName,
1114 absIntegerName, signumIntegerName,
1115 leIntegerPrimName, gtIntegerPrimName, ltIntegerPrimName, geIntegerPrimName,
1116 compareIntegerName, quotRemIntegerName, divModIntegerName,
1117 quotIntegerName, remIntegerName, divIntegerName, modIntegerName,
1118 floatFromIntegerName, doubleFromIntegerName,
1119 encodeFloatIntegerName, encodeDoubleIntegerName,
1120 decodeDoubleIntegerName,
1121 gcdIntegerName, lcmIntegerName,
1122 andIntegerName, orIntegerName, xorIntegerName, complementIntegerName,
1123 shiftLIntegerName, shiftRIntegerName, bitIntegerName :: Name
1124 integerTyConName = tcQual gHC_INTEGER_TYPE (fsLit "Integer") integerTyConKey
1125 integerSDataConName = dcQual gHC_INTEGER_TYPE (fsLit "S#") integerSDataConKey
1126 mkIntegerName = varQual gHC_INTEGER_TYPE (fsLit "mkInteger") mkIntegerIdKey
1127 integerToWord64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToWord64") integerToWord64IdKey
1128 integerToInt64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToInt64") integerToInt64IdKey
1129 word64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "word64ToInteger") word64ToIntegerIdKey
1130 int64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "int64ToInteger") int64ToIntegerIdKey
1131 plusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "plusInteger") plusIntegerIdKey
1132 timesIntegerName = varQual gHC_INTEGER_TYPE (fsLit "timesInteger") timesIntegerIdKey
1133 smallIntegerName = varQual gHC_INTEGER_TYPE (fsLit "smallInteger") smallIntegerIdKey
1134 wordToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "wordToInteger") wordToIntegerIdKey
1135 integerToWordName = varQual gHC_INTEGER_TYPE (fsLit "integerToWord") integerToWordIdKey
1136 integerToIntName = varQual gHC_INTEGER_TYPE (fsLit "integerToInt") integerToIntIdKey
1137 minusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "minusInteger") minusIntegerIdKey
1138 negateIntegerName = varQual gHC_INTEGER_TYPE (fsLit "negateInteger") negateIntegerIdKey
1139 eqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "eqInteger#") eqIntegerPrimIdKey
1140 neqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "neqInteger#") neqIntegerPrimIdKey
1141 absIntegerName = varQual gHC_INTEGER_TYPE (fsLit "absInteger") absIntegerIdKey
1142 signumIntegerName = varQual gHC_INTEGER_TYPE (fsLit "signumInteger") signumIntegerIdKey
1143 leIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "leInteger#") leIntegerPrimIdKey
1144 gtIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "gtInteger#") gtIntegerPrimIdKey
1145 ltIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "ltInteger#") ltIntegerPrimIdKey
1146 geIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "geInteger#") geIntegerPrimIdKey
1147 compareIntegerName = varQual gHC_INTEGER_TYPE (fsLit "compareInteger") compareIntegerIdKey
1148 quotRemIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotRemInteger") quotRemIntegerIdKey
1149 divModIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divModInteger") divModIntegerIdKey
1150 quotIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotInteger") quotIntegerIdKey
1151 remIntegerName = varQual gHC_INTEGER_TYPE (fsLit "remInteger") remIntegerIdKey
1152 divIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divInteger") divIntegerIdKey
1153 modIntegerName = varQual gHC_INTEGER_TYPE (fsLit "modInteger") modIntegerIdKey
1154 floatFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "floatFromInteger") floatFromIntegerIdKey
1155 doubleFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "doubleFromInteger") doubleFromIntegerIdKey
1156 encodeFloatIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeFloatInteger") encodeFloatIntegerIdKey
1157 encodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeDoubleInteger") encodeDoubleIntegerIdKey
1158 decodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "decodeDoubleInteger") decodeDoubleIntegerIdKey
1159 gcdIntegerName = varQual gHC_INTEGER_TYPE (fsLit "gcdInteger") gcdIntegerIdKey
1160 lcmIntegerName = varQual gHC_INTEGER_TYPE (fsLit "lcmInteger") lcmIntegerIdKey
1161 andIntegerName = varQual gHC_INTEGER_TYPE (fsLit "andInteger") andIntegerIdKey
1162 orIntegerName = varQual gHC_INTEGER_TYPE (fsLit "orInteger") orIntegerIdKey
1163 xorIntegerName = varQual gHC_INTEGER_TYPE (fsLit "xorInteger") xorIntegerIdKey
1164 complementIntegerName = varQual gHC_INTEGER_TYPE (fsLit "complementInteger") complementIntegerIdKey
1165 shiftLIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftLInteger") shiftLIntegerIdKey
1166 shiftRIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftRInteger") shiftRIntegerIdKey
1167 bitIntegerName = varQual gHC_INTEGER_TYPE (fsLit "bitInteger") bitIntegerIdKey
1168
1169 -- GHC.Natural types
1170 naturalTyConName, naturalSDataConName :: Name
1171 naturalTyConName = tcQual gHC_NATURAL (fsLit "Natural") naturalTyConKey
1172 naturalSDataConName = dcQual gHC_NATURAL (fsLit "NatS#") naturalSDataConKey
1173
1174 naturalFromIntegerName :: Name
1175 naturalFromIntegerName = varQual gHC_NATURAL (fsLit "naturalFromInteger") naturalFromIntegerIdKey
1176
1177 naturalToIntegerName, plusNaturalName, minusNaturalName, timesNaturalName,
1178 mkNaturalName, wordToNaturalName :: Name
1179 naturalToIntegerName = varQual gHC_NATURAL (fsLit "naturalToInteger") naturalToIntegerIdKey
1180 plusNaturalName = varQual gHC_NATURAL (fsLit "plusNatural") plusNaturalIdKey
1181 minusNaturalName = varQual gHC_NATURAL (fsLit "minusNatural") minusNaturalIdKey
1182 timesNaturalName = varQual gHC_NATURAL (fsLit "timesNatural") timesNaturalIdKey
1183 mkNaturalName = varQual gHC_NATURAL (fsLit "mkNatural") mkNaturalIdKey
1184 wordToNaturalName = varQual gHC_NATURAL (fsLit "wordToNatural#") wordToNaturalIdKey
1185
1186 -- GHC.Real types and classes
1187 rationalTyConName, ratioTyConName, ratioDataConName, realClassName,
1188 integralClassName, realFracClassName, fractionalClassName,
1189 fromRationalName, toIntegerName, toRationalName, fromIntegralName,
1190 realToFracName :: Name
1191 rationalTyConName = tcQual gHC_REAL (fsLit "Rational") rationalTyConKey
1192 ratioTyConName = tcQual gHC_REAL (fsLit "Ratio") ratioTyConKey
1193 ratioDataConName = dcQual gHC_REAL (fsLit ":%") ratioDataConKey
1194 realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey
1195 integralClassName = clsQual gHC_REAL (fsLit "Integral") integralClassKey
1196 realFracClassName = clsQual gHC_REAL (fsLit "RealFrac") realFracClassKey
1197 fractionalClassName = clsQual gHC_REAL (fsLit "Fractional") fractionalClassKey
1198 fromRationalName = varQual gHC_REAL (fsLit "fromRational") fromRationalClassOpKey
1199 toIntegerName = varQual gHC_REAL (fsLit "toInteger") toIntegerClassOpKey
1200 toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey
1201 fromIntegralName = varQual gHC_REAL (fsLit "fromIntegral")fromIntegralIdKey
1202 realToFracName = varQual gHC_REAL (fsLit "realToFrac") realToFracIdKey
1203
1204 -- PrelFloat classes
1205 floatingClassName, realFloatClassName :: Name
1206 floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey
1207 realFloatClassName = clsQual gHC_FLOAT (fsLit "RealFloat") realFloatClassKey
1208
1209 -- other GHC.Float functions
1210 rationalToFloatName, rationalToDoubleName :: Name
1211 rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey
1212 rationalToDoubleName = varQual gHC_FLOAT (fsLit "rationalToDouble") rationalToDoubleIdKey
1213
1214 -- Class Ix
1215 ixClassName :: Name
1216 ixClassName = clsQual gHC_ARR (fsLit "Ix") ixClassKey
1217
1218 -- Typeable representation types
1219 trModuleTyConName
1220 , trModuleDataConName
1221 , trNameTyConName
1222 , trNameSDataConName
1223 , trNameDDataConName
1224 , trTyConTyConName
1225 , trTyConDataConName
1226 :: Name
1227 trModuleTyConName = tcQual gHC_TYPES (fsLit "Module") trModuleTyConKey
1228 trModuleDataConName = dcQual gHC_TYPES (fsLit "Module") trModuleDataConKey
1229 trNameTyConName = tcQual gHC_TYPES (fsLit "TrName") trNameTyConKey
1230 trNameSDataConName = dcQual gHC_TYPES (fsLit "TrNameS") trNameSDataConKey
1231 trNameDDataConName = dcQual gHC_TYPES (fsLit "TrNameD") trNameDDataConKey
1232 trTyConTyConName = tcQual gHC_TYPES (fsLit "TyCon") trTyConTyConKey
1233 trTyConDataConName = dcQual gHC_TYPES (fsLit "TyCon") trTyConDataConKey
1234
1235 kindRepTyConName
1236 , kindRepTyConAppDataConName
1237 , kindRepVarDataConName
1238 , kindRepAppDataConName
1239 , kindRepFunDataConName
1240 , kindRepTYPEDataConName
1241 , kindRepTypeLitSDataConName
1242 , kindRepTypeLitDDataConName
1243 :: Name
1244 kindRepTyConName = tcQual gHC_TYPES (fsLit "KindRep") kindRepTyConKey
1245 kindRepTyConAppDataConName = dcQual gHC_TYPES (fsLit "KindRepTyConApp") kindRepTyConAppDataConKey
1246 kindRepVarDataConName = dcQual gHC_TYPES (fsLit "KindRepVar") kindRepVarDataConKey
1247 kindRepAppDataConName = dcQual gHC_TYPES (fsLit "KindRepApp") kindRepAppDataConKey
1248 kindRepFunDataConName = dcQual gHC_TYPES (fsLit "KindRepFun") kindRepFunDataConKey
1249 kindRepTYPEDataConName = dcQual gHC_TYPES (fsLit "KindRepTYPE") kindRepTYPEDataConKey
1250 kindRepTypeLitSDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitS") kindRepTypeLitSDataConKey
1251 kindRepTypeLitDDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitD") kindRepTypeLitDDataConKey
1252
1253 typeLitSortTyConName
1254 , typeLitSymbolDataConName
1255 , typeLitNatDataConName
1256 :: Name
1257 typeLitSortTyConName = tcQual gHC_TYPES (fsLit "TypeLitSort") typeLitSortTyConKey
1258 typeLitSymbolDataConName = dcQual gHC_TYPES (fsLit "TypeLitSymbol") typeLitSymbolDataConKey
1259 typeLitNatDataConName = dcQual gHC_TYPES (fsLit "TypeLitNat") typeLitNatDataConKey
1260
1261 -- Class Typeable, and functions for constructing `Typeable` dictionaries
1262 typeableClassName
1263 , typeRepTyConName
1264 , someTypeRepTyConName
1265 , someTypeRepDataConName
1266 , mkTrTypeName
1267 , mkTrConName
1268 , mkTrAppName
1269 , mkTrFunName
1270 , typeRepIdName
1271 , typeNatTypeRepName
1272 , typeSymbolTypeRepName
1273 , trGhcPrimModuleName
1274 :: Name
1275 typeableClassName = clsQual tYPEABLE_INTERNAL (fsLit "Typeable") typeableClassKey
1276 typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey
1277 someTypeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepTyConKey
1278 someTypeRepDataConName = dcQual tYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepDataConKey
1279 typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
1280 mkTrTypeName = varQual tYPEABLE_INTERNAL (fsLit "mkTrType") mkTrTypeKey
1281 mkTrConName = varQual tYPEABLE_INTERNAL (fsLit "mkTrCon") mkTrConKey
1282 mkTrAppName = varQual tYPEABLE_INTERNAL (fsLit "mkTrApp") mkTrAppKey
1283 mkTrFunName = varQual tYPEABLE_INTERNAL (fsLit "mkTrFun") mkTrFunKey
1284 typeNatTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeNatTypeRep") typeNatTypeRepKey
1285 typeSymbolTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeSymbolTypeRep") typeSymbolTypeRepKey
1286 -- this is the Typeable 'Module' for GHC.Prim (which has no code, so we place in GHC.Types)
1287 -- See Note [Grand plan for Typeable] in TcTypeable.
1288 trGhcPrimModuleName = varQual gHC_TYPES (fsLit "tr$ModuleGHCPrim") trGhcPrimModuleKey
1289
1290 -- Typeable KindReps for some common cases
1291 starKindRepName, starArrStarKindRepName, starArrStarArrStarKindRepName :: Name
1292 starKindRepName = varQual gHC_TYPES (fsLit "krep$*") starKindRepKey
1293 starArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*Arr*") starArrStarKindRepKey
1294 starArrStarArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*->*->*") starArrStarArrStarKindRepKey
1295
1296 -- Custom type errors
1297 errorMessageTypeErrorFamName
1298 , typeErrorTextDataConName
1299 , typeErrorAppendDataConName
1300 , typeErrorVAppendDataConName
1301 , typeErrorShowTypeDataConName
1302 :: Name
1303
1304 errorMessageTypeErrorFamName =
1305 tcQual gHC_TYPELITS (fsLit "TypeError") errorMessageTypeErrorFamKey
1306
1307 typeErrorTextDataConName =
1308 dcQual gHC_TYPELITS (fsLit "Text") typeErrorTextDataConKey
1309
1310 typeErrorAppendDataConName =
1311 dcQual gHC_TYPELITS (fsLit ":<>:") typeErrorAppendDataConKey
1312
1313 typeErrorVAppendDataConName =
1314 dcQual gHC_TYPELITS (fsLit ":$$:") typeErrorVAppendDataConKey
1315
1316 typeErrorShowTypeDataConName =
1317 dcQual gHC_TYPELITS (fsLit "ShowType") typeErrorShowTypeDataConKey
1318
1319
1320
1321 -- Dynamic
1322 toDynName :: Name
1323 toDynName = varQual dYNAMIC (fsLit "toDyn") toDynIdKey
1324
1325 -- Class Data
1326 dataClassName :: Name
1327 dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey
1328
1329 -- Error module
1330 assertErrorName :: Name
1331 assertErrorName = varQual gHC_IO_Exception (fsLit "assertError") assertErrorIdKey
1332
1333 -- Debug.Trace
1334 traceName :: Name
1335 traceName = varQual dEBUG_TRACE (fsLit "trace") traceKey
1336
1337 -- Enum module (Enum, Bounded)
1338 enumClassName, enumFromName, enumFromToName, enumFromThenName,
1339 enumFromThenToName, boundedClassName :: Name
1340 enumClassName = clsQual gHC_ENUM (fsLit "Enum") enumClassKey
1341 enumFromName = varQual gHC_ENUM (fsLit "enumFrom") enumFromClassOpKey
1342 enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey
1343 enumFromThenName = varQual gHC_ENUM (fsLit "enumFromThen") enumFromThenClassOpKey
1344 enumFromThenToName = varQual gHC_ENUM (fsLit "enumFromThenTo") enumFromThenToClassOpKey
1345 boundedClassName = clsQual gHC_ENUM (fsLit "Bounded") boundedClassKey
1346
1347 -- List functions
1348 concatName, filterName, zipName :: Name
1349 concatName = varQual gHC_LIST (fsLit "concat") concatIdKey
1350 filterName = varQual gHC_LIST (fsLit "filter") filterIdKey
1351 zipName = varQual gHC_LIST (fsLit "zip") zipIdKey
1352
1353 -- Overloaded lists
1354 isListClassName, fromListName, fromListNName, toListName :: Name
1355 isListClassName = clsQual gHC_EXTS (fsLit "IsList") isListClassKey
1356 fromListName = varQual gHC_EXTS (fsLit "fromList") fromListClassOpKey
1357 fromListNName = varQual gHC_EXTS (fsLit "fromListN") fromListNClassOpKey
1358 toListName = varQual gHC_EXTS (fsLit "toList") toListClassOpKey
1359
1360 -- Class Show
1361 showClassName :: Name
1362 showClassName = clsQual gHC_SHOW (fsLit "Show") showClassKey
1363
1364 -- Class Read
1365 readClassName :: Name
1366 readClassName = clsQual gHC_READ (fsLit "Read") readClassKey
1367
1368 -- Classes Generic and Generic1, Datatype, Constructor and Selector
1369 genClassName, gen1ClassName, datatypeClassName, constructorClassName,
1370 selectorClassName :: Name
1371 genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey
1372 gen1ClassName = clsQual gHC_GENERICS (fsLit "Generic1") gen1ClassKey
1373
1374 datatypeClassName = clsQual gHC_GENERICS (fsLit "Datatype") datatypeClassKey
1375 constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey
1376 selectorClassName = clsQual gHC_GENERICS (fsLit "Selector") selectorClassKey
1377
1378 genericClassNames :: [Name]
1379 genericClassNames = [genClassName, gen1ClassName]
1380
1381 -- GHCi things
1382 ghciIoClassName, ghciStepIoMName :: Name
1383 ghciIoClassName = clsQual gHC_GHCI (fsLit "GHCiSandboxIO") ghciIoClassKey
1384 ghciStepIoMName = varQual gHC_GHCI (fsLit "ghciStepIO") ghciStepIoMClassOpKey
1385
1386 -- IO things
1387 ioTyConName, ioDataConName,
1388 thenIOName, bindIOName, returnIOName, failIOName :: Name
1389 ioTyConName = tcQual gHC_TYPES (fsLit "IO") ioTyConKey
1390 ioDataConName = dcQual gHC_TYPES (fsLit "IO") ioDataConKey
1391 thenIOName = varQual gHC_BASE (fsLit "thenIO") thenIOIdKey
1392 bindIOName = varQual gHC_BASE (fsLit "bindIO") bindIOIdKey
1393 returnIOName = varQual gHC_BASE (fsLit "returnIO") returnIOIdKey
1394 failIOName = varQual gHC_IO (fsLit "failIO") failIOIdKey
1395
1396 -- IO things
1397 printName :: Name
1398 printName = varQual sYSTEM_IO (fsLit "print") printIdKey
1399
1400 -- Int, Word, and Addr things
1401 int8TyConName, int16TyConName, int32TyConName, int64TyConName :: Name
1402 int8TyConName = tcQual gHC_INT (fsLit "Int8") int8TyConKey
1403 int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey
1404 int32TyConName = tcQual gHC_INT (fsLit "Int32") int32TyConKey
1405 int64TyConName = tcQual gHC_INT (fsLit "Int64") int64TyConKey
1406
1407 -- Word module
1408 word16TyConName, word32TyConName, word64TyConName :: Name
1409 word16TyConName = tcQual gHC_WORD (fsLit "Word16") word16TyConKey
1410 word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
1411 word64TyConName = tcQual gHC_WORD (fsLit "Word64") word64TyConKey
1412
1413 -- PrelPtr module
1414 ptrTyConName, funPtrTyConName :: Name
1415 ptrTyConName = tcQual gHC_PTR (fsLit "Ptr") ptrTyConKey
1416 funPtrTyConName = tcQual gHC_PTR (fsLit "FunPtr") funPtrTyConKey
1417
1418 -- Foreign objects and weak pointers
1419 stablePtrTyConName, newStablePtrName :: Name
1420 stablePtrTyConName = tcQual gHC_STABLE (fsLit "StablePtr") stablePtrTyConKey
1421 newStablePtrName = varQual gHC_STABLE (fsLit "newStablePtr") newStablePtrIdKey
1422
1423 -- Recursive-do notation
1424 monadFixClassName, mfixName :: Name
1425 monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey
1426 mfixName = varQual mONAD_FIX (fsLit "mfix") mfixIdKey
1427
1428 -- Arrow notation
1429 arrAName, composeAName, firstAName, appAName, choiceAName, loopAName :: Name
1430 arrAName = varQual aRROW (fsLit "arr") arrAIdKey
1431 composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey
1432 firstAName = varQual aRROW (fsLit "first") firstAIdKey
1433 appAName = varQual aRROW (fsLit "app") appAIdKey
1434 choiceAName = varQual aRROW (fsLit "|||") choiceAIdKey
1435 loopAName = varQual aRROW (fsLit "loop") loopAIdKey
1436
1437 -- Monad comprehensions
1438 guardMName, liftMName, mzipName :: Name
1439 guardMName = varQual mONAD (fsLit "guard") guardMIdKey
1440 liftMName = varQual mONAD (fsLit "liftM") liftMIdKey
1441 mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey
1442
1443
1444 -- Annotation type checking
1445 toAnnotationWrapperName :: Name
1446 toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey
1447
1448 -- Other classes, needed for type defaulting
1449 monadPlusClassName, randomClassName, randomGenClassName,
1450 isStringClassName :: Name
1451 monadPlusClassName = clsQual mONAD (fsLit "MonadPlus") monadPlusClassKey
1452 randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey
1453 randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey
1454 isStringClassName = clsQual dATA_STRING (fsLit "IsString") isStringClassKey
1455
1456 -- Type-level naturals
1457 knownNatClassName :: Name
1458 knownNatClassName = clsQual gHC_TYPENATS (fsLit "KnownNat") knownNatClassNameKey
1459 knownSymbolClassName :: Name
1460 knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey
1461
1462 -- Overloaded labels
1463 isLabelClassName :: Name
1464 isLabelClassName
1465 = clsQual gHC_OVER_LABELS (fsLit "IsLabel") isLabelClassNameKey
1466
1467 -- Implicit Parameters
1468 ipClassName :: Name
1469 ipClassName
1470 = clsQual gHC_CLASSES (fsLit "IP") ipClassKey
1471
1472 -- Overloaded record fields
1473 hasFieldClassName :: Name
1474 hasFieldClassName
1475 = clsQual gHC_RECORDS (fsLit "HasField") hasFieldClassNameKey
1476
1477 -- Source Locations
1478 callStackTyConName, emptyCallStackName, pushCallStackName,
1479 srcLocDataConName :: Name
1480 callStackTyConName
1481 = tcQual gHC_STACK_TYPES (fsLit "CallStack") callStackTyConKey
1482 emptyCallStackName
1483 = varQual gHC_STACK_TYPES (fsLit "emptyCallStack") emptyCallStackKey
1484 pushCallStackName
1485 = varQual gHC_STACK_TYPES (fsLit "pushCallStack") pushCallStackKey
1486 srcLocDataConName
1487 = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey
1488
1489 -- plugins
1490 pLUGINS :: Module
1491 pLUGINS = mkThisGhcModule (fsLit "Plugins")
1492 pluginTyConName :: Name
1493 pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
1494 frontendPluginTyConName :: Name
1495 frontendPluginTyConName = tcQual pLUGINS (fsLit "FrontendPlugin") frontendPluginTyConKey
1496
1497 -- Static pointers
1498 makeStaticName :: Name
1499 makeStaticName =
1500 varQual gHC_STATICPTR_INTERNAL (fsLit "makeStatic") makeStaticKey
1501
1502 staticPtrInfoTyConName :: Name
1503 staticPtrInfoTyConName =
1504 tcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoTyConKey
1505
1506 staticPtrInfoDataConName :: Name
1507 staticPtrInfoDataConName =
1508 dcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoDataConKey
1509
1510 staticPtrTyConName :: Name
1511 staticPtrTyConName =
1512 tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
1513
1514 staticPtrDataConName :: Name
1515 staticPtrDataConName =
1516 dcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrDataConKey
1517
1518 fromStaticPtrName :: Name
1519 fromStaticPtrName =
1520 varQual gHC_STATICPTR (fsLit "fromStaticPtr") fromStaticPtrClassOpKey
1521
1522 fingerprintDataConName :: Name
1523 fingerprintDataConName =
1524 dcQual gHC_FINGERPRINT_TYPE (fsLit "Fingerprint") fingerprintDataConKey
1525
1526 {-
1527 ************************************************************************
1528 * *
1529 \subsection{Local helpers}
1530 * *
1531 ************************************************************************
1532
1533 All these are original names; hence mkOrig
1534 -}
1535
1536 varQual, tcQual, clsQual, dcQual :: Module -> FastString -> Unique -> Name
1537 varQual = mk_known_key_name varName
1538 tcQual = mk_known_key_name tcName
1539 clsQual = mk_known_key_name clsName
1540 dcQual = mk_known_key_name dataName
1541
1542 mk_known_key_name :: NameSpace -> Module -> FastString -> Unique -> Name
1543 mk_known_key_name space modu str unique
1544 = mkExternalName unique modu (mkOccNameFS space str) noSrcSpan
1545
1546
1547 {-
1548 ************************************************************************
1549 * *
1550 \subsubsection[Uniques-prelude-Classes]{@Uniques@ for wired-in @Classes@}
1551 * *
1552 ************************************************************************
1553 --MetaHaskell extension hand allocate keys here
1554 -}
1555
1556 boundedClassKey, enumClassKey, eqClassKey, floatingClassKey,
1557 fractionalClassKey, integralClassKey, monadClassKey, dataClassKey,
1558 functorClassKey, numClassKey, ordClassKey, readClassKey, realClassKey,
1559 realFloatClassKey, realFracClassKey, showClassKey, ixClassKey :: Unique
1560 boundedClassKey = mkPreludeClassUnique 1
1561 enumClassKey = mkPreludeClassUnique 2
1562 eqClassKey = mkPreludeClassUnique 3
1563 floatingClassKey = mkPreludeClassUnique 5
1564 fractionalClassKey = mkPreludeClassUnique 6
1565 integralClassKey = mkPreludeClassUnique 7
1566 monadClassKey = mkPreludeClassUnique 8
1567 dataClassKey = mkPreludeClassUnique 9
1568 functorClassKey = mkPreludeClassUnique 10
1569 numClassKey = mkPreludeClassUnique 11
1570 ordClassKey = mkPreludeClassUnique 12
1571 readClassKey = mkPreludeClassUnique 13
1572 realClassKey = mkPreludeClassUnique 14
1573 realFloatClassKey = mkPreludeClassUnique 15
1574 realFracClassKey = mkPreludeClassUnique 16
1575 showClassKey = mkPreludeClassUnique 17
1576 ixClassKey = mkPreludeClassUnique 18
1577
1578 typeableClassKey, typeable1ClassKey, typeable2ClassKey, typeable3ClassKey,
1579 typeable4ClassKey, typeable5ClassKey, typeable6ClassKey, typeable7ClassKey
1580 :: Unique
1581 typeableClassKey = mkPreludeClassUnique 20
1582 typeable1ClassKey = mkPreludeClassUnique 21
1583 typeable2ClassKey = mkPreludeClassUnique 22
1584 typeable3ClassKey = mkPreludeClassUnique 23
1585 typeable4ClassKey = mkPreludeClassUnique 24
1586 typeable5ClassKey = mkPreludeClassUnique 25
1587 typeable6ClassKey = mkPreludeClassUnique 26
1588 typeable7ClassKey = mkPreludeClassUnique 27
1589
1590 monadFixClassKey :: Unique
1591 monadFixClassKey = mkPreludeClassUnique 28
1592
1593 monadFailClassKey :: Unique
1594 monadFailClassKey = mkPreludeClassUnique 29
1595
1596 monadPlusClassKey, randomClassKey, randomGenClassKey :: Unique
1597 monadPlusClassKey = mkPreludeClassUnique 30
1598 randomClassKey = mkPreludeClassUnique 31
1599 randomGenClassKey = mkPreludeClassUnique 32
1600
1601 isStringClassKey :: Unique
1602 isStringClassKey = mkPreludeClassUnique 33
1603
1604 applicativeClassKey, foldableClassKey, traversableClassKey :: Unique
1605 applicativeClassKey = mkPreludeClassUnique 34
1606 foldableClassKey = mkPreludeClassUnique 35
1607 traversableClassKey = mkPreludeClassUnique 36
1608
1609 genClassKey, gen1ClassKey, datatypeClassKey, constructorClassKey,
1610 selectorClassKey :: Unique
1611 genClassKey = mkPreludeClassUnique 37
1612 gen1ClassKey = mkPreludeClassUnique 38
1613
1614 datatypeClassKey = mkPreludeClassUnique 39
1615 constructorClassKey = mkPreludeClassUnique 40
1616 selectorClassKey = mkPreludeClassUnique 41
1617
1618 -- KnownNat: see Note [KnowNat & KnownSymbol and EvLit] in TcEvidence
1619 knownNatClassNameKey :: Unique
1620 knownNatClassNameKey = mkPreludeClassUnique 42
1621
1622 -- KnownSymbol: see Note [KnownNat & KnownSymbol and EvLit] in TcEvidence
1623 knownSymbolClassNameKey :: Unique
1624 knownSymbolClassNameKey = mkPreludeClassUnique 43
1625
1626 ghciIoClassKey :: Unique
1627 ghciIoClassKey = mkPreludeClassUnique 44
1628
1629 isLabelClassNameKey :: Unique
1630 isLabelClassNameKey = mkPreludeClassUnique 45
1631
1632 semigroupClassKey, monoidClassKey :: Unique
1633 semigroupClassKey = mkPreludeClassUnique 46
1634 monoidClassKey = mkPreludeClassUnique 47
1635
1636 -- Implicit Parameters
1637 ipClassKey :: Unique
1638 ipClassKey = mkPreludeClassUnique 48
1639
1640 -- Overloaded record fields
1641 hasFieldClassNameKey :: Unique
1642 hasFieldClassNameKey = mkPreludeClassUnique 49
1643
1644
1645 ---------------- Template Haskell -------------------
1646 -- THNames.hs: USES ClassUniques 200-299
1647 -----------------------------------------------------
1648
1649 {-
1650 ************************************************************************
1651 * *
1652 \subsubsection[Uniques-prelude-TyCons]{@Uniques@ for wired-in @TyCons@}
1653 * *
1654 ************************************************************************
1655 -}
1656
1657 addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey,
1658 byteArrayPrimTyConKey, charPrimTyConKey, charTyConKey, doublePrimTyConKey,
1659 doubleTyConKey, floatPrimTyConKey, floatTyConKey, funTyConKey,
1660 intPrimTyConKey, intTyConKey, int8TyConKey, int16TyConKey,
1661 int8PrimTyConKey, int16PrimTyConKey, int32PrimTyConKey, int32TyConKey,
1662 int64PrimTyConKey, int64TyConKey,
1663 integerTyConKey, naturalTyConKey,
1664 listTyConKey, foreignObjPrimTyConKey, maybeTyConKey,
1665 weakPrimTyConKey, mutableArrayPrimTyConKey, mutableArrayArrayPrimTyConKey,
1666 mutableByteArrayPrimTyConKey, orderingTyConKey, mVarPrimTyConKey,
1667 ratioTyConKey, rationalTyConKey, realWorldTyConKey, stablePtrPrimTyConKey,
1668 stablePtrTyConKey, eqTyConKey, heqTyConKey,
1669 smallArrayPrimTyConKey, smallMutableArrayPrimTyConKey :: Unique
1670 addrPrimTyConKey = mkPreludeTyConUnique 1
1671 arrayPrimTyConKey = mkPreludeTyConUnique 3
1672 boolTyConKey = mkPreludeTyConUnique 4
1673 byteArrayPrimTyConKey = mkPreludeTyConUnique 5
1674 charPrimTyConKey = mkPreludeTyConUnique 7
1675 charTyConKey = mkPreludeTyConUnique 8
1676 doublePrimTyConKey = mkPreludeTyConUnique 9
1677 doubleTyConKey = mkPreludeTyConUnique 10
1678 floatPrimTyConKey = mkPreludeTyConUnique 11
1679 floatTyConKey = mkPreludeTyConUnique 12
1680 funTyConKey = mkPreludeTyConUnique 13
1681 intPrimTyConKey = mkPreludeTyConUnique 14
1682 intTyConKey = mkPreludeTyConUnique 15
1683 int8PrimTyConKey = mkPreludeTyConUnique 16
1684 int8TyConKey = mkPreludeTyConUnique 17
1685 int16PrimTyConKey = mkPreludeTyConUnique 18
1686 int16TyConKey = mkPreludeTyConUnique 19
1687 int32PrimTyConKey = mkPreludeTyConUnique 20
1688 int32TyConKey = mkPreludeTyConUnique 21
1689 int64PrimTyConKey = mkPreludeTyConUnique 22
1690 int64TyConKey = mkPreludeTyConUnique 23
1691 integerTyConKey = mkPreludeTyConUnique 24
1692 naturalTyConKey = mkPreludeTyConUnique 25
1693
1694 listTyConKey = mkPreludeTyConUnique 26
1695 foreignObjPrimTyConKey = mkPreludeTyConUnique 27
1696 maybeTyConKey = mkPreludeTyConUnique 28
1697 weakPrimTyConKey = mkPreludeTyConUnique 29
1698 mutableArrayPrimTyConKey = mkPreludeTyConUnique 30
1699 mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 31
1700 orderingTyConKey = mkPreludeTyConUnique 32
1701 mVarPrimTyConKey = mkPreludeTyConUnique 33
1702 ratioTyConKey = mkPreludeTyConUnique 34
1703 rationalTyConKey = mkPreludeTyConUnique 35
1704 realWorldTyConKey = mkPreludeTyConUnique 36
1705 stablePtrPrimTyConKey = mkPreludeTyConUnique 37
1706 stablePtrTyConKey = mkPreludeTyConUnique 38
1707 eqTyConKey = mkPreludeTyConUnique 40
1708 heqTyConKey = mkPreludeTyConUnique 41
1709 arrayArrayPrimTyConKey = mkPreludeTyConUnique 42
1710 mutableArrayArrayPrimTyConKey = mkPreludeTyConUnique 43
1711
1712 statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey,
1713 mutVarPrimTyConKey, ioTyConKey,
1714 wordPrimTyConKey, wordTyConKey, word8PrimTyConKey, word8TyConKey,
1715 word16PrimTyConKey, word16TyConKey, word32PrimTyConKey, word32TyConKey,
1716 word64PrimTyConKey, word64TyConKey,
1717 liftedConKey, unliftedConKey, anyBoxConKey, kindConKey, boxityConKey,
1718 typeConKey, threadIdPrimTyConKey, bcoPrimTyConKey, ptrTyConKey,
1719 funPtrTyConKey, tVarPrimTyConKey, eqPrimTyConKey,
1720 eqReprPrimTyConKey, eqPhantPrimTyConKey, voidPrimTyConKey,
1721 compactPrimTyConKey :: Unique
1722 statePrimTyConKey = mkPreludeTyConUnique 50
1723 stableNamePrimTyConKey = mkPreludeTyConUnique 51
1724 stableNameTyConKey = mkPreludeTyConUnique 52
1725 eqPrimTyConKey = mkPreludeTyConUnique 53
1726 eqReprPrimTyConKey = mkPreludeTyConUnique 54
1727 eqPhantPrimTyConKey = mkPreludeTyConUnique 55
1728 mutVarPrimTyConKey = mkPreludeTyConUnique 56
1729 ioTyConKey = mkPreludeTyConUnique 57
1730 voidPrimTyConKey = mkPreludeTyConUnique 58
1731 wordPrimTyConKey = mkPreludeTyConUnique 59
1732 wordTyConKey = mkPreludeTyConUnique 60
1733 word8PrimTyConKey = mkPreludeTyConUnique 61
1734 word8TyConKey = mkPreludeTyConUnique 62
1735 word16PrimTyConKey = mkPreludeTyConUnique 63
1736 word16TyConKey = mkPreludeTyConUnique 64
1737 word32PrimTyConKey = mkPreludeTyConUnique 65
1738 word32TyConKey = mkPreludeTyConUnique 66
1739 word64PrimTyConKey = mkPreludeTyConUnique 67
1740 word64TyConKey = mkPreludeTyConUnique 68
1741 liftedConKey = mkPreludeTyConUnique 69
1742 unliftedConKey = mkPreludeTyConUnique 70
1743 anyBoxConKey = mkPreludeTyConUnique 71
1744 kindConKey = mkPreludeTyConUnique 72
1745 boxityConKey = mkPreludeTyConUnique 73
1746 typeConKey = mkPreludeTyConUnique 74
1747 threadIdPrimTyConKey = mkPreludeTyConUnique 75
1748 bcoPrimTyConKey = mkPreludeTyConUnique 76
1749 ptrTyConKey = mkPreludeTyConUnique 77
1750 funPtrTyConKey = mkPreludeTyConUnique 78
1751 tVarPrimTyConKey = mkPreludeTyConUnique 79
1752 compactPrimTyConKey = mkPreludeTyConUnique 80
1753
1754 -- dotnet interop
1755 objectTyConKey :: Unique
1756 objectTyConKey = mkPreludeTyConUnique 83
1757
1758 eitherTyConKey :: Unique
1759 eitherTyConKey = mkPreludeTyConUnique 84
1760
1761 -- Kind constructors
1762 liftedTypeKindTyConKey, tYPETyConKey,
1763 constraintKindTyConKey, runtimeRepTyConKey,
1764 vecCountTyConKey, vecElemTyConKey :: Unique
1765 liftedTypeKindTyConKey = mkPreludeTyConUnique 87
1766 tYPETyConKey = mkPreludeTyConUnique 88
1767 constraintKindTyConKey = mkPreludeTyConUnique 92
1768 runtimeRepTyConKey = mkPreludeTyConUnique 95
1769 vecCountTyConKey = mkPreludeTyConUnique 96
1770 vecElemTyConKey = mkPreludeTyConUnique 97
1771
1772 pluginTyConKey, frontendPluginTyConKey :: Unique
1773 pluginTyConKey = mkPreludeTyConUnique 102
1774 frontendPluginTyConKey = mkPreludeTyConUnique 103
1775
1776 unknownTyConKey, unknown1TyConKey, unknown2TyConKey, unknown3TyConKey,
1777 opaqueTyConKey :: Unique
1778 unknownTyConKey = mkPreludeTyConUnique 129
1779 unknown1TyConKey = mkPreludeTyConUnique 130
1780 unknown2TyConKey = mkPreludeTyConUnique 131
1781 unknown3TyConKey = mkPreludeTyConUnique 132
1782 opaqueTyConKey = mkPreludeTyConUnique 133
1783
1784 -- Generics (Unique keys)
1785 v1TyConKey, u1TyConKey, par1TyConKey, rec1TyConKey,
1786 k1TyConKey, m1TyConKey, sumTyConKey, prodTyConKey,
1787 compTyConKey, rTyConKey, dTyConKey,
1788 cTyConKey, sTyConKey, rec0TyConKey,
1789 d1TyConKey, c1TyConKey, s1TyConKey, noSelTyConKey,
1790 repTyConKey, rep1TyConKey, uRecTyConKey,
1791 uAddrTyConKey, uCharTyConKey, uDoubleTyConKey,
1792 uFloatTyConKey, uIntTyConKey, uWordTyConKey :: Unique
1793
1794 v1TyConKey = mkPreludeTyConUnique 135
1795 u1TyConKey = mkPreludeTyConUnique 136
1796 par1TyConKey = mkPreludeTyConUnique 137
1797 rec1TyConKey = mkPreludeTyConUnique 138
1798 k1TyConKey = mkPreludeTyConUnique 139
1799 m1TyConKey = mkPreludeTyConUnique 140
1800
1801 sumTyConKey = mkPreludeTyConUnique 141
1802 prodTyConKey = mkPreludeTyConUnique 142
1803 compTyConKey = mkPreludeTyConUnique 143
1804
1805 rTyConKey = mkPreludeTyConUnique 144
1806 dTyConKey = mkPreludeTyConUnique 146
1807 cTyConKey = mkPreludeTyConUnique 147
1808 sTyConKey = mkPreludeTyConUnique 148
1809
1810 rec0TyConKey = mkPreludeTyConUnique 149
1811 d1TyConKey = mkPreludeTyConUnique 151
1812 c1TyConKey = mkPreludeTyConUnique 152
1813 s1TyConKey = mkPreludeTyConUnique 153
1814 noSelTyConKey = mkPreludeTyConUnique 154
1815
1816 repTyConKey = mkPreludeTyConUnique 155
1817 rep1TyConKey = mkPreludeTyConUnique 156
1818
1819 uRecTyConKey = mkPreludeTyConUnique 157
1820 uAddrTyConKey = mkPreludeTyConUnique 158
1821 uCharTyConKey = mkPreludeTyConUnique 159
1822 uDoubleTyConKey = mkPreludeTyConUnique 160
1823 uFloatTyConKey = mkPreludeTyConUnique 161
1824 uIntTyConKey = mkPreludeTyConUnique 162
1825 uWordTyConKey = mkPreludeTyConUnique 163
1826
1827 -- Type-level naturals
1828 typeNatKindConNameKey, typeSymbolKindConNameKey,
1829 typeNatAddTyFamNameKey, typeNatMulTyFamNameKey, typeNatExpTyFamNameKey,
1830 typeNatLeqTyFamNameKey, typeNatSubTyFamNameKey
1831 , typeSymbolCmpTyFamNameKey, typeNatCmpTyFamNameKey
1832 , typeNatDivTyFamNameKey
1833 , typeNatModTyFamNameKey
1834 , typeNatLogTyFamNameKey
1835 :: Unique
1836 typeNatKindConNameKey = mkPreludeTyConUnique 164
1837 typeSymbolKindConNameKey = mkPreludeTyConUnique 165
1838 typeNatAddTyFamNameKey = mkPreludeTyConUnique 166
1839 typeNatMulTyFamNameKey = mkPreludeTyConUnique 167
1840 typeNatExpTyFamNameKey = mkPreludeTyConUnique 168
1841 typeNatLeqTyFamNameKey = mkPreludeTyConUnique 169
1842 typeNatSubTyFamNameKey = mkPreludeTyConUnique 170
1843 typeSymbolCmpTyFamNameKey = mkPreludeTyConUnique 171
1844 typeNatCmpTyFamNameKey = mkPreludeTyConUnique 172
1845 typeNatDivTyFamNameKey = mkPreludeTyConUnique 173
1846 typeNatModTyFamNameKey = mkPreludeTyConUnique 174
1847 typeNatLogTyFamNameKey = mkPreludeTyConUnique 175
1848
1849 -- Custom user type-errors
1850 errorMessageTypeErrorFamKey :: Unique
1851 errorMessageTypeErrorFamKey = mkPreludeTyConUnique 176
1852
1853
1854
1855 ntTyConKey:: Unique
1856 ntTyConKey = mkPreludeTyConUnique 177
1857 coercibleTyConKey :: Unique
1858 coercibleTyConKey = mkPreludeTyConUnique 178
1859
1860 proxyPrimTyConKey :: Unique
1861 proxyPrimTyConKey = mkPreludeTyConUnique 179
1862
1863 specTyConKey :: Unique
1864 specTyConKey = mkPreludeTyConUnique 180
1865
1866 anyTyConKey :: Unique
1867 anyTyConKey = mkPreludeTyConUnique 181
1868
1869 smallArrayPrimTyConKey = mkPreludeTyConUnique 182
1870 smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 183
1871
1872 staticPtrTyConKey :: Unique
1873 staticPtrTyConKey = mkPreludeTyConUnique 184
1874
1875 staticPtrInfoTyConKey :: Unique
1876 staticPtrInfoTyConKey = mkPreludeTyConUnique 185
1877
1878 callStackTyConKey :: Unique
1879 callStackTyConKey = mkPreludeTyConUnique 186
1880
1881 -- Typeables
1882 typeRepTyConKey, someTypeRepTyConKey, someTypeRepDataConKey :: Unique
1883 typeRepTyConKey = mkPreludeTyConUnique 187
1884 someTypeRepTyConKey = mkPreludeTyConUnique 188
1885 someTypeRepDataConKey = mkPreludeTyConUnique 189
1886
1887
1888 typeSymbolAppendFamNameKey :: Unique
1889 typeSymbolAppendFamNameKey = mkPreludeTyConUnique 190
1890
1891 ---------------- Template Haskell -------------------
1892 -- THNames.hs: USES TyConUniques 200-299
1893 -----------------------------------------------------
1894
1895 ----------------------- SIMD ------------------------
1896 -- USES TyConUniques 300-399
1897 -----------------------------------------------------
1898
1899 #include "primop-vector-uniques.hs-incl"
1900
1901 {-
1902 ************************************************************************
1903 * *
1904 \subsubsection[Uniques-prelude-DataCons]{@Uniques@ for wired-in @DataCons@}
1905 * *
1906 ************************************************************************
1907 -}
1908
1909 charDataConKey, consDataConKey, doubleDataConKey, falseDataConKey,
1910 floatDataConKey, intDataConKey, integerSDataConKey, nilDataConKey,
1911 ratioDataConKey, stableNameDataConKey, trueDataConKey, wordDataConKey,
1912 word8DataConKey, ioDataConKey, integerDataConKey, heqDataConKey,
1913 coercibleDataConKey, eqDataConKey, nothingDataConKey, justDataConKey :: Unique
1914
1915 charDataConKey = mkPreludeDataConUnique 1
1916 consDataConKey = mkPreludeDataConUnique 2
1917 doubleDataConKey = mkPreludeDataConUnique 3
1918 falseDataConKey = mkPreludeDataConUnique 4
1919 floatDataConKey = mkPreludeDataConUnique 5
1920 intDataConKey = mkPreludeDataConUnique 6
1921 integerSDataConKey = mkPreludeDataConUnique 7
1922 nothingDataConKey = mkPreludeDataConUnique 8
1923 justDataConKey = mkPreludeDataConUnique 9
1924 eqDataConKey = mkPreludeDataConUnique 10
1925 nilDataConKey = mkPreludeDataConUnique 11
1926 ratioDataConKey = mkPreludeDataConUnique 12
1927 word8DataConKey = mkPreludeDataConUnique 13
1928 stableNameDataConKey = mkPreludeDataConUnique 14
1929 trueDataConKey = mkPreludeDataConUnique 15
1930 wordDataConKey = mkPreludeDataConUnique 16
1931 ioDataConKey = mkPreludeDataConUnique 17
1932 integerDataConKey = mkPreludeDataConUnique 18
1933 heqDataConKey = mkPreludeDataConUnique 19
1934
1935 -- Generic data constructors
1936 crossDataConKey, inlDataConKey, inrDataConKey, genUnitDataConKey :: Unique
1937 crossDataConKey = mkPreludeDataConUnique 20
1938 inlDataConKey = mkPreludeDataConUnique 21
1939 inrDataConKey = mkPreludeDataConUnique 22
1940 genUnitDataConKey = mkPreludeDataConUnique 23
1941
1942 leftDataConKey, rightDataConKey :: Unique
1943 leftDataConKey = mkPreludeDataConUnique 25
1944 rightDataConKey = mkPreludeDataConUnique 26
1945
1946 ordLTDataConKey, ordEQDataConKey, ordGTDataConKey :: Unique
1947 ordLTDataConKey = mkPreludeDataConUnique 27
1948 ordEQDataConKey = mkPreludeDataConUnique 28
1949 ordGTDataConKey = mkPreludeDataConUnique 29
1950
1951
1952 coercibleDataConKey = mkPreludeDataConUnique 32
1953
1954 staticPtrDataConKey :: Unique
1955 staticPtrDataConKey = mkPreludeDataConUnique 33
1956
1957 staticPtrInfoDataConKey :: Unique
1958 staticPtrInfoDataConKey = mkPreludeDataConUnique 34
1959
1960 fingerprintDataConKey :: Unique
1961 fingerprintDataConKey = mkPreludeDataConUnique 35
1962
1963 srcLocDataConKey :: Unique
1964 srcLocDataConKey = mkPreludeDataConUnique 37
1965
1966 trTyConTyConKey, trTyConDataConKey,
1967 trModuleTyConKey, trModuleDataConKey,
1968 trNameTyConKey, trNameSDataConKey, trNameDDataConKey,
1969 trGhcPrimModuleKey, kindRepTyConKey,
1970 typeLitSortTyConKey :: Unique
1971 trTyConTyConKey = mkPreludeDataConUnique 40
1972 trTyConDataConKey = mkPreludeDataConUnique 41
1973 trModuleTyConKey = mkPreludeDataConUnique 42
1974 trModuleDataConKey = mkPreludeDataConUnique 43
1975 trNameTyConKey = mkPreludeDataConUnique 44
1976 trNameSDataConKey = mkPreludeDataConUnique 45
1977 trNameDDataConKey = mkPreludeDataConUnique 46
1978 trGhcPrimModuleKey = mkPreludeDataConUnique 47
1979 kindRepTyConKey = mkPreludeDataConUnique 48
1980 typeLitSortTyConKey = mkPreludeDataConUnique 49
1981
1982 typeErrorTextDataConKey,
1983 typeErrorAppendDataConKey,
1984 typeErrorVAppendDataConKey,
1985 typeErrorShowTypeDataConKey
1986 :: Unique
1987 typeErrorTextDataConKey = mkPreludeDataConUnique 50
1988 typeErrorAppendDataConKey = mkPreludeDataConUnique 51
1989 typeErrorVAppendDataConKey = mkPreludeDataConUnique 52
1990 typeErrorShowTypeDataConKey = mkPreludeDataConUnique 53
1991
1992 prefixIDataConKey, infixIDataConKey, leftAssociativeDataConKey,
1993 rightAssociativeDataConKey, notAssociativeDataConKey,
1994 sourceUnpackDataConKey, sourceNoUnpackDataConKey,
1995 noSourceUnpackednessDataConKey, sourceLazyDataConKey,
1996 sourceStrictDataConKey, noSourceStrictnessDataConKey,
1997 decidedLazyDataConKey, decidedStrictDataConKey, decidedUnpackDataConKey,
1998 metaDataDataConKey, metaConsDataConKey, metaSelDataConKey :: Unique
1999 prefixIDataConKey = mkPreludeDataConUnique 54
2000 infixIDataConKey = mkPreludeDataConUnique 55
2001 leftAssociativeDataConKey = mkPreludeDataConUnique 56
2002 rightAssociativeDataConKey = mkPreludeDataConUnique 57
2003 notAssociativeDataConKey = mkPreludeDataConUnique 58
2004 sourceUnpackDataConKey = mkPreludeDataConUnique 59
2005 sourceNoUnpackDataConKey = mkPreludeDataConUnique 60
2006 noSourceUnpackednessDataConKey = mkPreludeDataConUnique 61
2007 sourceLazyDataConKey = mkPreludeDataConUnique 62
2008 sourceStrictDataConKey = mkPreludeDataConUnique 63
2009 noSourceStrictnessDataConKey = mkPreludeDataConUnique 64
2010 decidedLazyDataConKey = mkPreludeDataConUnique 65
2011 decidedStrictDataConKey = mkPreludeDataConUnique 66
2012 decidedUnpackDataConKey = mkPreludeDataConUnique 67
2013 metaDataDataConKey = mkPreludeDataConUnique 68
2014 metaConsDataConKey = mkPreludeDataConUnique 69
2015 metaSelDataConKey = mkPreludeDataConUnique 70
2016
2017 vecRepDataConKey, tupleRepDataConKey, sumRepDataConKey :: Unique
2018 vecRepDataConKey = mkPreludeDataConUnique 71
2019 tupleRepDataConKey = mkPreludeDataConUnique 72
2020 sumRepDataConKey = mkPreludeDataConUnique 73
2021
2022 -- See Note [Wiring in RuntimeRep] in TysWiredIn
2023 runtimeRepSimpleDataConKeys, unliftedSimpleRepDataConKeys, unliftedRepDataConKeys :: [Unique]
2024 liftedRepDataConKey :: Unique
2025 runtimeRepSimpleDataConKeys@(liftedRepDataConKey : unliftedSimpleRepDataConKeys)
2026 = map mkPreludeDataConUnique [74..86]
2027
2028 unliftedRepDataConKeys = vecRepDataConKey :
2029 tupleRepDataConKey :
2030 sumRepDataConKey :
2031 unliftedSimpleRepDataConKeys
2032
2033 -- See Note [Wiring in RuntimeRep] in TysWiredIn
2034 -- VecCount
2035 vecCountDataConKeys :: [Unique]
2036 vecCountDataConKeys = map mkPreludeDataConUnique [87..92]
2037
2038 -- See Note [Wiring in RuntimeRep] in TysWiredIn
2039 -- VecElem
2040 vecElemDataConKeys :: [Unique]
2041 vecElemDataConKeys = map mkPreludeDataConUnique [93..102]
2042
2043 -- Typeable things
2044 kindRepTyConAppDataConKey, kindRepVarDataConKey, kindRepAppDataConKey,
2045 kindRepFunDataConKey, kindRepTYPEDataConKey,
2046 kindRepTypeLitSDataConKey, kindRepTypeLitDDataConKey
2047 :: Unique
2048 kindRepTyConAppDataConKey = mkPreludeDataConUnique 103
2049 kindRepVarDataConKey = mkPreludeDataConUnique 104
2050 kindRepAppDataConKey = mkPreludeDataConUnique 105
2051 kindRepFunDataConKey = mkPreludeDataConUnique 106
2052 kindRepTYPEDataConKey = mkPreludeDataConUnique 107
2053 kindRepTypeLitSDataConKey = mkPreludeDataConUnique 108
2054 kindRepTypeLitDDataConKey = mkPreludeDataConUnique 109
2055
2056 typeLitSymbolDataConKey, typeLitNatDataConKey :: Unique
2057 typeLitSymbolDataConKey = mkPreludeDataConUnique 110
2058 typeLitNatDataConKey = mkPreludeDataConUnique 111
2059
2060
2061 ---------------- Template Haskell -------------------
2062 -- THNames.hs: USES DataUniques 200-250
2063 -----------------------------------------------------
2064
2065
2066 {-
2067 ************************************************************************
2068 * *
2069 \subsubsection[Uniques-prelude-Ids]{@Uniques@ for wired-in @Ids@ (except @DataCons@)}
2070 * *
2071 ************************************************************************
2072 -}
2073
2074 wildCardKey, absentErrorIdKey, augmentIdKey, appendIdKey,
2075 buildIdKey, errorIdKey, foldrIdKey, recSelErrorIdKey,
2076 seqIdKey, eqStringIdKey,
2077 noMethodBindingErrorIdKey, nonExhaustiveGuardsErrorIdKey,
2078 runtimeErrorIdKey, patErrorIdKey, voidPrimIdKey,
2079 realWorldPrimIdKey, recConErrorIdKey,
2080 unpackCStringUtf8IdKey, unpackCStringAppendIdKey,
2081 unpackCStringFoldrIdKey, unpackCStringIdKey,
2082 typeErrorIdKey, divIntIdKey, modIntIdKey,
2083 absentSumFieldErrorIdKey :: Unique
2084
2085 wildCardKey = mkPreludeMiscIdUnique 0 -- See Note [WildCard binders]
2086 absentErrorIdKey = mkPreludeMiscIdUnique 1
2087 augmentIdKey = mkPreludeMiscIdUnique 2
2088 appendIdKey = mkPreludeMiscIdUnique 3
2089 buildIdKey = mkPreludeMiscIdUnique 4
2090 errorIdKey = mkPreludeMiscIdUnique 5
2091 foldrIdKey = mkPreludeMiscIdUnique 6
2092 recSelErrorIdKey = mkPreludeMiscIdUnique 7
2093 seqIdKey = mkPreludeMiscIdUnique 8
2094 eqStringIdKey = mkPreludeMiscIdUnique 10
2095 noMethodBindingErrorIdKey = mkPreludeMiscIdUnique 11
2096 nonExhaustiveGuardsErrorIdKey = mkPreludeMiscIdUnique 12
2097 runtimeErrorIdKey = mkPreludeMiscIdUnique 13
2098 patErrorIdKey = mkPreludeMiscIdUnique 14
2099 realWorldPrimIdKey = mkPreludeMiscIdUnique 15
2100 recConErrorIdKey = mkPreludeMiscIdUnique 16
2101 unpackCStringUtf8IdKey = mkPreludeMiscIdUnique 17
2102 unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18
2103 unpackCStringFoldrIdKey = mkPreludeMiscIdUnique 19
2104 unpackCStringIdKey = mkPreludeMiscIdUnique 20
2105 voidPrimIdKey = mkPreludeMiscIdUnique 21
2106 typeErrorIdKey = mkPreludeMiscIdUnique 22
2107 divIntIdKey = mkPreludeMiscIdUnique 23
2108 modIntIdKey = mkPreludeMiscIdUnique 24
2109 absentSumFieldErrorIdKey = mkPreludeMiscIdUnique 9
2110
2111 unsafeCoerceIdKey, concatIdKey, filterIdKey, zipIdKey, bindIOIdKey,
2112 returnIOIdKey, newStablePtrIdKey,
2113 printIdKey, failIOIdKey, nullAddrIdKey, voidArgIdKey,
2114 fstIdKey, sndIdKey, otherwiseIdKey, assertIdKey :: Unique
2115 unsafeCoerceIdKey = mkPreludeMiscIdUnique 30
2116 concatIdKey = mkPreludeMiscIdUnique 31
2117 filterIdKey = mkPreludeMiscIdUnique 32
2118 zipIdKey = mkPreludeMiscIdUnique 33
2119 bindIOIdKey = mkPreludeMiscIdUnique 34
2120 returnIOIdKey = mkPreludeMiscIdUnique 35
2121 newStablePtrIdKey = mkPreludeMiscIdUnique 36
2122 printIdKey = mkPreludeMiscIdUnique 37
2123 failIOIdKey = mkPreludeMiscIdUnique 38
2124 nullAddrIdKey = mkPreludeMiscIdUnique 39
2125 voidArgIdKey = mkPreludeMiscIdUnique 40
2126 fstIdKey = mkPreludeMiscIdUnique 41
2127 sndIdKey = mkPreludeMiscIdUnique 42
2128 otherwiseIdKey = mkPreludeMiscIdUnique 43
2129 assertIdKey = mkPreludeMiscIdUnique 44
2130
2131 mkIntegerIdKey, smallIntegerIdKey, wordToIntegerIdKey,
2132 integerToWordIdKey, integerToIntIdKey,
2133 integerToWord64IdKey, integerToInt64IdKey,
2134 word64ToIntegerIdKey, int64ToIntegerIdKey,
2135 plusIntegerIdKey, timesIntegerIdKey, minusIntegerIdKey,
2136 negateIntegerIdKey,
2137 eqIntegerPrimIdKey, neqIntegerPrimIdKey, absIntegerIdKey, signumIntegerIdKey,
2138 leIntegerPrimIdKey, gtIntegerPrimIdKey, ltIntegerPrimIdKey, geIntegerPrimIdKey,
2139 compareIntegerIdKey, quotRemIntegerIdKey, divModIntegerIdKey,
2140 quotIntegerIdKey, remIntegerIdKey, divIntegerIdKey, modIntegerIdKey,
2141 floatFromIntegerIdKey, doubleFromIntegerIdKey,
2142 encodeFloatIntegerIdKey, encodeDoubleIntegerIdKey,
2143 decodeDoubleIntegerIdKey,
2144 gcdIntegerIdKey, lcmIntegerIdKey,
2145 andIntegerIdKey, orIntegerIdKey, xorIntegerIdKey, complementIntegerIdKey,
2146 shiftLIntegerIdKey, shiftRIntegerIdKey :: Unique
2147 mkIntegerIdKey = mkPreludeMiscIdUnique 60
2148 smallIntegerIdKey = mkPreludeMiscIdUnique 61
2149 integerToWordIdKey = mkPreludeMiscIdUnique 62
2150 integerToIntIdKey = mkPreludeMiscIdUnique 63
2151 integerToWord64IdKey = mkPreludeMiscIdUnique 64
2152 integerToInt64IdKey = mkPreludeMiscIdUnique 65
2153 plusIntegerIdKey = mkPreludeMiscIdUnique 66
2154 timesIntegerIdKey = mkPreludeMiscIdUnique 67
2155 minusIntegerIdKey = mkPreludeMiscIdUnique 68
2156 negateIntegerIdKey = mkPreludeMiscIdUnique 69
2157 eqIntegerPrimIdKey = mkPreludeMiscIdUnique 70
2158 neqIntegerPrimIdKey = mkPreludeMiscIdUnique 71
2159 absIntegerIdKey = mkPreludeMiscIdUnique 72
2160 signumIntegerIdKey = mkPreludeMiscIdUnique 73
2161 leIntegerPrimIdKey = mkPreludeMiscIdUnique 74
2162 gtIntegerPrimIdKey = mkPreludeMiscIdUnique 75
2163 ltIntegerPrimIdKey = mkPreludeMiscIdUnique 76
2164 geIntegerPrimIdKey = mkPreludeMiscIdUnique 77
2165 compareIntegerIdKey = mkPreludeMiscIdUnique 78
2166 quotIntegerIdKey = mkPreludeMiscIdUnique 79
2167 remIntegerIdKey = mkPreludeMiscIdUnique 80
2168 divIntegerIdKey = mkPreludeMiscIdUnique 81
2169 modIntegerIdKey = mkPreludeMiscIdUnique 82
2170 divModIntegerIdKey = mkPreludeMiscIdUnique 83
2171 quotRemIntegerIdKey = mkPreludeMiscIdUnique 84
2172 floatFromIntegerIdKey = mkPreludeMiscIdUnique 85
2173 doubleFromIntegerIdKey = mkPreludeMiscIdUnique 86
2174 encodeFloatIntegerIdKey = mkPreludeMiscIdUnique 87
2175 encodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 88
2176 gcdIntegerIdKey = mkPreludeMiscIdUnique 89
2177 lcmIntegerIdKey = mkPreludeMiscIdUnique 90
2178 andIntegerIdKey = mkPreludeMiscIdUnique 91
2179 orIntegerIdKey = mkPreludeMiscIdUnique 92
2180 xorIntegerIdKey = mkPreludeMiscIdUnique 93
2181 complementIntegerIdKey = mkPreludeMiscIdUnique 94
2182 shiftLIntegerIdKey = mkPreludeMiscIdUnique 95
2183 shiftRIntegerIdKey = mkPreludeMiscIdUnique 96
2184 wordToIntegerIdKey = mkPreludeMiscIdUnique 97
2185 word64ToIntegerIdKey = mkPreludeMiscIdUnique 98
2186 int64ToIntegerIdKey = mkPreludeMiscIdUnique 99
2187 decodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 100
2188
2189 rootMainKey, runMainKey :: Unique
2190 rootMainKey = mkPreludeMiscIdUnique 101
2191 runMainKey = mkPreludeMiscIdUnique 102
2192
2193 thenIOIdKey, lazyIdKey, assertErrorIdKey, oneShotKey, runRWKey :: Unique
2194 thenIOIdKey = mkPreludeMiscIdUnique 103
2195 lazyIdKey = mkPreludeMiscIdUnique 104
2196 assertErrorIdKey = mkPreludeMiscIdUnique 105
2197 oneShotKey = mkPreludeMiscIdUnique 106
2198 runRWKey = mkPreludeMiscIdUnique 107
2199
2200 traceKey :: Unique
2201 traceKey = mkPreludeMiscIdUnique 108
2202
2203 breakpointIdKey, breakpointCondIdKey :: Unique
2204 breakpointIdKey = mkPreludeMiscIdUnique 110
2205 breakpointCondIdKey = mkPreludeMiscIdUnique 111
2206
2207 inlineIdKey, noinlineIdKey :: Unique
2208 inlineIdKey = mkPreludeMiscIdUnique 120
2209 -- see below
2210
2211 mapIdKey, groupWithIdKey, dollarIdKey :: Unique
2212 mapIdKey = mkPreludeMiscIdUnique 121
2213 groupWithIdKey = mkPreludeMiscIdUnique 122
2214 dollarIdKey = mkPreludeMiscIdUnique 123
2215
2216 coercionTokenIdKey :: Unique
2217 coercionTokenIdKey = mkPreludeMiscIdUnique 124
2218
2219 noinlineIdKey = mkPreludeMiscIdUnique 125
2220
2221 rationalToFloatIdKey, rationalToDoubleIdKey :: Unique
2222 rationalToFloatIdKey = mkPreludeMiscIdUnique 130
2223 rationalToDoubleIdKey = mkPreludeMiscIdUnique 131
2224
2225 -- dotnet interop
2226 unmarshalObjectIdKey, marshalObjectIdKey, marshalStringIdKey,
2227 unmarshalStringIdKey, checkDotnetResNameIdKey :: Unique
2228 unmarshalObjectIdKey = mkPreludeMiscIdUnique 150
2229 marshalObjectIdKey = mkPreludeMiscIdUnique 151
2230 marshalStringIdKey = mkPreludeMiscIdUnique 152
2231 unmarshalStringIdKey = mkPreludeMiscIdUnique 153
2232 checkDotnetResNameIdKey = mkPreludeMiscIdUnique 154
2233
2234 undefinedKey :: Unique
2235 undefinedKey = mkPreludeMiscIdUnique 155
2236
2237 magicDictKey :: Unique
2238 magicDictKey = mkPreludeMiscIdUnique 156
2239
2240 coerceKey :: Unique
2241 coerceKey = mkPreludeMiscIdUnique 157
2242
2243 {-
2244 Certain class operations from Prelude classes. They get their own
2245 uniques so we can look them up easily when we want to conjure them up
2246 during type checking.
2247 -}
2248
2249 -- Just a placeholder for unbound variables produced by the renamer:
2250 unboundKey :: Unique
2251 unboundKey = mkPreludeMiscIdUnique 158
2252
2253 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey,
2254 enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey,
2255 enumFromThenToClassOpKey, eqClassOpKey, geClassOpKey, negateClassOpKey,
2256 failMClassOpKey_preMFP, bindMClassOpKey, thenMClassOpKey, returnMClassOpKey,
2257 fmapClassOpKey
2258 :: Unique
2259 fromIntegerClassOpKey = mkPreludeMiscIdUnique 160
2260 minusClassOpKey = mkPreludeMiscIdUnique 161
2261 fromRationalClassOpKey = mkPreludeMiscIdUnique 162
2262 enumFromClassOpKey = mkPreludeMiscIdUnique 163
2263 enumFromThenClassOpKey = mkPreludeMiscIdUnique 164
2264 enumFromToClassOpKey = mkPreludeMiscIdUnique 165
2265 enumFromThenToClassOpKey = mkPreludeMiscIdUnique 166
2266 eqClassOpKey = mkPreludeMiscIdUnique 167
2267 geClassOpKey = mkPreludeMiscIdUnique 168
2268 negateClassOpKey = mkPreludeMiscIdUnique 169
2269 failMClassOpKey_preMFP = mkPreludeMiscIdUnique 170
2270 bindMClassOpKey = mkPreludeMiscIdUnique 171 -- (>>=)
2271 thenMClassOpKey = mkPreludeMiscIdUnique 172 -- (>>)
2272 fmapClassOpKey = mkPreludeMiscIdUnique 173
2273 returnMClassOpKey = mkPreludeMiscIdUnique 174
2274
2275 -- Recursive do notation
2276 mfixIdKey :: Unique
2277 mfixIdKey = mkPreludeMiscIdUnique 175
2278
2279 -- MonadFail operations
2280 failMClassOpKey :: Unique
2281 failMClassOpKey = mkPreludeMiscIdUnique 176
2282
2283 -- Arrow notation
2284 arrAIdKey, composeAIdKey, firstAIdKey, appAIdKey, choiceAIdKey,
2285 loopAIdKey :: Unique
2286 arrAIdKey = mkPreludeMiscIdUnique 180
2287 composeAIdKey = mkPreludeMiscIdUnique 181 -- >>>
2288 firstAIdKey = mkPreludeMiscIdUnique 182
2289 appAIdKey = mkPreludeMiscIdUnique 183
2290 choiceAIdKey = mkPreludeMiscIdUnique 184 -- |||
2291 loopAIdKey = mkPreludeMiscIdUnique 185
2292
2293 fromStringClassOpKey :: Unique
2294 fromStringClassOpKey = mkPreludeMiscIdUnique 186
2295
2296 -- Annotation type checking
2297 toAnnotationWrapperIdKey :: Unique
2298 toAnnotationWrapperIdKey = mkPreludeMiscIdUnique 187
2299
2300 -- Conversion functions
2301 fromIntegralIdKey, realToFracIdKey, toIntegerClassOpKey, toRationalClassOpKey :: Unique
2302 fromIntegralIdKey = mkPreludeMiscIdUnique 190
2303 realToFracIdKey = mkPreludeMiscIdUnique 191
2304 toIntegerClassOpKey = mkPreludeMiscIdUnique 192
2305 toRationalClassOpKey = mkPreludeMiscIdUnique 193
2306
2307 -- Monad comprehensions
2308 guardMIdKey, liftMIdKey, mzipIdKey :: Unique
2309 guardMIdKey = mkPreludeMiscIdUnique 194
2310 liftMIdKey = mkPreludeMiscIdUnique 195
2311 mzipIdKey = mkPreludeMiscIdUnique 196
2312
2313 -- GHCi
2314 ghciStepIoMClassOpKey :: Unique
2315 ghciStepIoMClassOpKey = mkPreludeMiscIdUnique 197
2316
2317 -- Overloaded lists
2318 isListClassKey, fromListClassOpKey, fromListNClassOpKey, toListClassOpKey :: Unique
2319 isListClassKey = mkPreludeMiscIdUnique 198
2320 fromListClassOpKey = mkPreludeMiscIdUnique 199
2321 fromListNClassOpKey = mkPreludeMiscIdUnique 500
2322 toListClassOpKey = mkPreludeMiscIdUnique 501
2323
2324 proxyHashKey :: Unique
2325 proxyHashKey = mkPreludeMiscIdUnique 502
2326
2327 ---------------- Template Haskell -------------------
2328 -- THNames.hs: USES IdUniques 200-499
2329 -----------------------------------------------------
2330
2331 -- Used to make `Typeable` dictionaries
2332 mkTyConKey
2333 , mkTrTypeKey
2334 , mkTrConKey
2335 , mkTrAppKey
2336 , mkTrFunKey
2337 , typeNatTypeRepKey
2338 , typeSymbolTypeRepKey
2339 , typeRepIdKey
2340 :: Unique
2341 mkTyConKey = mkPreludeMiscIdUnique 503
2342 mkTrTypeKey = mkPreludeMiscIdUnique 504
2343 mkTrConKey = mkPreludeMiscIdUnique 505
2344 mkTrAppKey = mkPreludeMiscIdUnique 506
2345 typeNatTypeRepKey = mkPreludeMiscIdUnique 507
2346 typeSymbolTypeRepKey = mkPreludeMiscIdUnique 508
2347 typeRepIdKey = mkPreludeMiscIdUnique 509
2348 mkTrFunKey = mkPreludeMiscIdUnique 510
2349
2350 -- Representations for primitive types
2351 trTYPEKey
2352 ,trTYPE'PtrRepLiftedKey
2353 , trRuntimeRepKey
2354 , tr'PtrRepLiftedKey
2355 :: Unique
2356 trTYPEKey = mkPreludeMiscIdUnique 511
2357 trTYPE'PtrRepLiftedKey = mkPreludeMiscIdUnique 512
2358 trRuntimeRepKey = mkPreludeMiscIdUnique 513
2359 tr'PtrRepLiftedKey = mkPreludeMiscIdUnique 514
2360
2361 -- KindReps for common cases
2362 starKindRepKey, starArrStarKindRepKey, starArrStarArrStarKindRepKey :: Unique
2363 starKindRepKey = mkPreludeMiscIdUnique 520
2364 starArrStarKindRepKey = mkPreludeMiscIdUnique 521
2365 starArrStarArrStarKindRepKey = mkPreludeMiscIdUnique 522
2366
2367 -- Dynamic
2368 toDynIdKey :: Unique
2369 toDynIdKey = mkPreludeMiscIdUnique 523
2370
2371
2372 bitIntegerIdKey :: Unique
2373 bitIntegerIdKey = mkPreludeMiscIdUnique 550
2374
2375 heqSCSelIdKey, eqSCSelIdKey, coercibleSCSelIdKey :: Unique
2376 eqSCSelIdKey = mkPreludeMiscIdUnique 551
2377 heqSCSelIdKey = mkPreludeMiscIdUnique 552
2378 coercibleSCSelIdKey = mkPreludeMiscIdUnique 553
2379
2380 sappendClassOpKey :: Unique
2381 sappendClassOpKey = mkPreludeMiscIdUnique 554
2382
2383 memptyClassOpKey, mappendClassOpKey, mconcatClassOpKey :: Unique
2384 memptyClassOpKey = mkPreludeMiscIdUnique 555
2385 mappendClassOpKey = mkPreludeMiscIdUnique 556
2386 mconcatClassOpKey = mkPreludeMiscIdUnique 557
2387
2388 emptyCallStackKey, pushCallStackKey :: Unique
2389 emptyCallStackKey = mkPreludeMiscIdUnique 558
2390 pushCallStackKey = mkPreludeMiscIdUnique 559
2391
2392 fromStaticPtrClassOpKey :: Unique
2393 fromStaticPtrClassOpKey = mkPreludeMiscIdUnique 560
2394
2395 makeStaticKey :: Unique
2396 makeStaticKey = mkPreludeMiscIdUnique 561
2397
2398 -- Natural
2399 naturalFromIntegerIdKey, naturalToIntegerIdKey, plusNaturalIdKey,
2400 minusNaturalIdKey, timesNaturalIdKey, mkNaturalIdKey,
2401 naturalSDataConKey, wordToNaturalIdKey :: Unique
2402 naturalFromIntegerIdKey = mkPreludeMiscIdUnique 562
2403 naturalToIntegerIdKey = mkPreludeMiscIdUnique 563
2404 plusNaturalIdKey = mkPreludeMiscIdUnique 564
2405 minusNaturalIdKey = mkPreludeMiscIdUnique 565
2406 timesNaturalIdKey = mkPreludeMiscIdUnique 566
2407 mkNaturalIdKey = mkPreludeMiscIdUnique 567
2408 naturalSDataConKey = mkPreludeMiscIdUnique 568
2409 wordToNaturalIdKey = mkPreludeMiscIdUnique 569
2410
2411 {-
2412 ************************************************************************
2413 * *
2414 \subsection[Class-std-groups]{Standard groups of Prelude classes}
2415 * *
2416 ************************************************************************
2417
2418 NOTE: @Eq@ and @Text@ do need to appear in @standardClasses@
2419 even though every numeric class has these two as a superclass,
2420 because the list of ambiguous dictionaries hasn't been simplified.
2421 -}
2422
2423 numericClassKeys :: [Unique]
2424 numericClassKeys =
2425 [ numClassKey
2426 , realClassKey
2427 , integralClassKey
2428 ]
2429 ++ fractionalClassKeys
2430
2431 fractionalClassKeys :: [Unique]
2432 fractionalClassKeys =
2433 [ fractionalClassKey
2434 , floatingClassKey
2435 , realFracClassKey
2436 , realFloatClassKey
2437 ]
2438
2439 -- The "standard classes" are used in defaulting (Haskell 98 report 4.3.4),
2440 -- and are: "classes defined in the Prelude or a standard library"
2441 standardClassKeys :: [Unique]
2442 standardClassKeys = derivableClassKeys ++ numericClassKeys
2443 ++ [randomClassKey, randomGenClassKey,
2444 functorClassKey,
2445 monadClassKey, monadPlusClassKey, monadFailClassKey,
2446 semigroupClassKey, monoidClassKey,
2447 isStringClassKey,
2448 applicativeClassKey, foldableClassKey,
2449 traversableClassKey, alternativeClassKey
2450 ]
2451
2452 {-
2453 @derivableClassKeys@ is also used in checking \tr{deriving} constructs
2454 (@TcDeriv@).
2455 -}
2456
2457 derivableClassKeys :: [Unique]
2458 derivableClassKeys
2459 = [ eqClassKey, ordClassKey, enumClassKey, ixClassKey,
2460 boundedClassKey, showClassKey, readClassKey ]
2461
2462
2463 -- These are the "interactive classes" that are consulted when doing
2464 -- defaulting. Does not include Num or IsString, which have special
2465 -- handling.
2466 interactiveClassNames :: [Name]
2467 interactiveClassNames
2468 = [ showClassName, eqClassName, ordClassName, foldableClassName
2469 , traversableClassName ]
2470
2471 interactiveClassKeys :: [Unique]
2472 interactiveClassKeys = map getUnique interactiveClassNames
2473
2474 {-
2475 ************************************************************************
2476 * *
2477 Semi-builtin names
2478 * *
2479 ************************************************************************
2480
2481 The following names should be considered by GHCi to be in scope always.
2482
2483 -}
2484
2485 pretendNameIsInScope :: Name -> Bool
2486 pretendNameIsInScope n
2487 = any (n `hasKey`)
2488 [ liftedTypeKindTyConKey, tYPETyConKey
2489 , runtimeRepTyConKey, liftedRepDataConKey ]