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