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