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