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