Generate Typeable info at definition sites
[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 may 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), we have
77 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.
81
82 This is accomplished through a variety of mechanisms:
83
84 a) The parser recognises them specially and generates an
85 Exact Name (hence not looked up in the orig-name cache)
86
87 b) The known infinite families of names are specially
88 serialised by BinIface.putName, with that special treatment
89 detected when we read back to ensure that we get back to the
90 correct uniques.
91
92 Most of the infinite families cannot occur in source code,
93 so mechanisms (a,b) sufficies to ensure that they always have
94 the right Unique. In particular, implicit param TyCon names,
95 constraint tuples and Any TyCons cannot be mentioned by the
96 user.
97
98 c) IfaceEnv.lookupOrigNameCache uses isBuiltInOcc_maybe to map
99 built-in syntax directly onto the corresponding name, rather
100 than trying to find it in the original-name cache.
101
102 See also Note [Built-in syntax and the OrigNameCache]
103 -}
104
105 {-# LANGUAGE CPP #-}
106
107 module PrelNames (
108 Unique, Uniquable(..), hasKey, -- Re-exported for convenience
109
110 -----------------------------------------------------------
111 module PrelNames, -- A huge bunch of (a) Names, e.g. intTyConName
112 -- (b) Uniques e.g. intTyConKey
113 -- (c) Groups of classes and types
114 -- (d) miscellaneous things
115 -- So many that we export them all
116 ) where
117
118 #include "HsVersions.h"
119
120 import Module
121 import OccName
122 import RdrName
123 import Unique
124 import Name
125 import SrcLoc
126 import FastString
127 import Config ( cIntegerLibraryType, IntegerLibrary(..) )
128 import Panic ( panic )
129
130 {-
131 ************************************************************************
132 * *
133 allNameStrings
134 * *
135 ************************************************************************
136 -}
137
138 allNameStrings :: [String]
139 -- Infinite list of a,b,c...z, aa, ab, ac, ... etc
140 allNameStrings = [ c:cs | cs <- "" : allNameStrings, c <- ['a'..'z'] ]
141
142 {-
143 ************************************************************************
144 * *
145 \subsection{Local Names}
146 * *
147 ************************************************************************
148
149 This *local* name is used by the interactive stuff
150 -}
151
152 itName :: Unique -> SrcSpan -> Name
153 itName uniq loc = mkInternalName uniq (mkOccNameFS varName (fsLit "it")) loc
154
155 -- mkUnboundName makes a place-holder Name; it shouldn't be looked at except possibly
156 -- during compiler debugging.
157 mkUnboundName :: RdrName -> Name
158 mkUnboundName rdr_name = mkInternalName unboundKey (rdrNameOcc rdr_name) noSrcSpan
159
160 isUnboundName :: Name -> Bool
161 isUnboundName name = name `hasKey` unboundKey
162
163 {-
164 ************************************************************************
165 * *
166 \subsection{Known key Names}
167 * *
168 ************************************************************************
169
170 This section tells what the compiler knows about the association of
171 names with uniques. These ones are the *non* wired-in ones. The
172 wired in ones are defined in TysWiredIn etc.
173 -}
174
175 basicKnownKeyNames :: [Name]
176 basicKnownKeyNames
177 = genericTyConNames
178 ++ [ -- Classes. *Must* include:
179 -- classes that are grabbed by key (e.g., eqClassKey)
180 -- classes in "Class.standardClassKeys" (quite a few)
181 eqClassName, -- mentioned, derivable
182 ordClassName, -- derivable
183 boundedClassName, -- derivable
184 numClassName, -- mentioned, numeric
185 enumClassName, -- derivable
186 monadClassName,
187 functorClassName,
188 realClassName, -- numeric
189 integralClassName, -- numeric
190 fractionalClassName, -- numeric
191 floatingClassName, -- numeric
192 realFracClassName, -- numeric
193 realFloatClassName, -- numeric
194 dataClassName,
195 isStringClassName,
196 applicativeClassName,
197 alternativeClassName,
198 foldableClassName,
199 traversableClassName,
200
201 -- The IO type
202 -- See Note [TyConRepNames for non-wired-in TyCons]
203 ioTyConName, ioDataConName,
204 runMainIOName,
205
206 -- Typeable
207 typeableClassName,
208 typeRepTyConName,
209 trTyConDataConName,
210 trModuleDataConName,
211 trNameSDataConName,
212 typeRepIdName,
213 mkPolyTyConAppName,
214 mkAppTyName,
215 typeSymbolTypeRepName, typeNatTypeRepName,
216
217 -- Dynamic
218 toDynName,
219
220 -- Numeric stuff
221 negateName, minusName, geName, eqName,
222
223 -- Conversion functions
224 rationalTyConName,
225 ratioTyConName, ratioDataConName,
226 fromRationalName, fromIntegerName,
227 toIntegerName, toRationalName,
228 fromIntegralName, realToFracName,
229
230 -- String stuff
231 fromStringName,
232
233 -- Enum stuff
234 enumFromName, enumFromThenName,
235 enumFromThenToName, enumFromToName,
236
237 -- Applicative/Alternative stuff
238 pureAName,
239 apAName,
240
241 -- Monad stuff
242 thenIOName, bindIOName, returnIOName, failIOName,
243 failMName, bindMName, thenMName, returnMName,
244 fmapName,
245 joinMName,
246
247 -- MonadFix
248 monadFixClassName, mfixName,
249
250 -- Arrow stuff
251 arrAName, composeAName, firstAName,
252 appAName, choiceAName, loopAName,
253
254 -- Ix stuff
255 ixClassName,
256
257 -- Show stuff
258 showClassName,
259
260 -- Read stuff
261 readClassName,
262
263 -- Stable pointers
264 newStablePtrName,
265
266 -- GHC Extensions
267 groupWithName,
268
269 -- Strings and lists
270 unpackCStringName,
271 unpackCStringFoldrName, unpackCStringUtf8Name,
272
273 -- Overloaded lists
274 isListClassName,
275 fromListName,
276 fromListNName,
277 toListName,
278
279 -- List operations
280 concatName, filterName, mapName,
281 zipName, foldrName, buildName, augmentName, appendName,
282
283 -- FFI primitive types that are not wired-in.
284 stablePtrTyConName, ptrTyConName, funPtrTyConName,
285 int8TyConName, int16TyConName, int32TyConName, int64TyConName,
286 word16TyConName, word32TyConName, word64TyConName,
287
288 -- Others
289 otherwiseIdName, inlineIdName,
290 eqStringName, assertName, breakpointName, breakpointCondName,
291 breakpointAutoName, opaqueTyConName,
292 assertErrorName,
293 printName, fstName, sndName,
294
295 -- Integer
296 integerTyConName, mkIntegerName,
297 integerToWord64Name, integerToInt64Name,
298 word64ToIntegerName, int64ToIntegerName,
299 plusIntegerName, timesIntegerName, smallIntegerName,
300 wordToIntegerName,
301 integerToWordName, integerToIntName, minusIntegerName,
302 negateIntegerName, eqIntegerPrimName, neqIntegerPrimName,
303 absIntegerName, signumIntegerName,
304 leIntegerPrimName, gtIntegerPrimName, ltIntegerPrimName, geIntegerPrimName,
305 compareIntegerName, quotRemIntegerName, divModIntegerName,
306 quotIntegerName, remIntegerName, divIntegerName, modIntegerName,
307 floatFromIntegerName, doubleFromIntegerName,
308 encodeFloatIntegerName, encodeDoubleIntegerName,
309 decodeDoubleIntegerName,
310 gcdIntegerName, lcmIntegerName,
311 andIntegerName, orIntegerName, xorIntegerName, complementIntegerName,
312 shiftLIntegerName, shiftRIntegerName, bitIntegerName,
313
314 -- Float/Double
315 rationalToFloatName,
316 rationalToDoubleName,
317
318 -- Other classes
319 randomClassName, randomGenClassName, monadPlusClassName,
320
321 -- Type-level naturals
322 knownNatClassName, knownSymbolClassName,
323
324 -- Source locations
325 callStackDataConName, callStackTyConName,
326 srcLocDataConName,
327
328 -- Annotation type checking
329 toAnnotationWrapperName
330
331 -- The Ordering type
332 , orderingTyConName
333 , ltDataConName, eqDataConName, gtDataConName
334
335 -- The SPEC type for SpecConstr
336 , specTyConName
337
338 -- The Either type
339 , eitherTyConName, leftDataConName, rightDataConName
340
341 -- Plugins
342 , pluginTyConName
343
344 -- Generics
345 , genClassName, gen1ClassName
346 , datatypeClassName, constructorClassName, selectorClassName
347
348 -- Monad comprehensions
349 , guardMName
350 , liftMName
351 , mzipName
352
353 -- GHCi Sandbox
354 , ghciIoClassName, ghciStepIoMName
355
356 -- StaticPtr
357 , staticPtrTyConName
358 , staticPtrDataConName, staticPtrInfoDataConName
359
360 -- Fingerprint
361 , fingerprintDataConName
362
363 ] ++ case cIntegerLibraryType of
364 IntegerGMP -> [integerSDataConName]
365 IntegerSimple -> []
366
367 genericTyConNames :: [Name]
368 genericTyConNames = [
369 v1TyConName, u1TyConName, par1TyConName, rec1TyConName,
370 k1TyConName, m1TyConName, sumTyConName, prodTyConName,
371 compTyConName, rTyConName, pTyConName, dTyConName,
372 cTyConName, sTyConName, rec0TyConName, par0TyConName,
373 d1TyConName, c1TyConName, s1TyConName, noSelTyConName,
374 repTyConName, rep1TyConName, uRecTyConName,
375 uAddrTyConName, uCharTyConName, uDoubleTyConName,
376 uFloatTyConName, uIntTyConName, uWordTyConName
377 ]
378
379 {-
380 ************************************************************************
381 * *
382 \subsection{Module names}
383 * *
384 ************************************************************************
385
386
387 --MetaHaskell Extension Add a new module here
388 -}
389
390 pRELUDE :: Module
391 pRELUDE = mkBaseModule_ pRELUDE_NAME
392
393 gHC_PRIM, gHC_TYPES, gHC_GENERICS, gHC_MAGIC,
394 gHC_CLASSES, gHC_BASE, gHC_ENUM, gHC_GHCI, gHC_CSTRING,
395 gHC_SHOW, gHC_READ, gHC_NUM, gHC_INTEGER_TYPE, gHC_LIST,
396 gHC_TUPLE, dATA_TUPLE, dATA_EITHER, dATA_STRING, dATA_FOLDABLE, dATA_TRAVERSABLE, dATA_MONOID,
397 gHC_CONC, gHC_IO, gHC_IO_Exception,
398 gHC_ST, gHC_ARR, gHC_STABLE, gHC_PTR, gHC_ERR, gHC_REAL,
399 gHC_FLOAT, gHC_TOP_HANDLER, sYSTEM_IO, dYNAMIC,
400 tYPEABLE, tYPEABLE_INTERNAL, gENERICS,
401 rEAD_PREC, lEX, gHC_INT, gHC_WORD, mONAD, mONAD_FIX, mONAD_ZIP,
402 aRROW, cONTROL_APPLICATIVE, gHC_DESUGAR, rANDOM, gHC_EXTS,
403 cONTROL_EXCEPTION_BASE, gHC_TYPELITS :: Module
404
405 gHC_PRIM = mkPrimModule (fsLit "GHC.Prim") -- Primitive types and values
406 gHC_TYPES = mkPrimModule (fsLit "GHC.Types")
407 gHC_MAGIC = mkPrimModule (fsLit "GHC.Magic")
408 gHC_CSTRING = mkPrimModule (fsLit "GHC.CString")
409 gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes")
410
411 gHC_BASE = mkBaseModule (fsLit "GHC.Base")
412 gHC_ENUM = mkBaseModule (fsLit "GHC.Enum")
413 gHC_GHCI = mkBaseModule (fsLit "GHC.GHCi")
414 gHC_SHOW = mkBaseModule (fsLit "GHC.Show")
415 gHC_READ = mkBaseModule (fsLit "GHC.Read")
416 gHC_NUM = mkBaseModule (fsLit "GHC.Num")
417 gHC_INTEGER_TYPE= mkIntegerModule (fsLit "GHC.Integer.Type")
418 gHC_LIST = mkBaseModule (fsLit "GHC.List")
419 gHC_TUPLE = mkPrimModule (fsLit "GHC.Tuple")
420 dATA_TUPLE = mkBaseModule (fsLit "Data.Tuple")
421 dATA_EITHER = mkBaseModule (fsLit "Data.Either")
422 dATA_STRING = mkBaseModule (fsLit "Data.String")
423 dATA_FOLDABLE = mkBaseModule (fsLit "Data.Foldable")
424 dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable")
425 dATA_MONOID = mkBaseModule (fsLit "Data.Monoid")
426 gHC_CONC = mkBaseModule (fsLit "GHC.Conc")
427 gHC_IO = mkBaseModule (fsLit "GHC.IO")
428 gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
429 gHC_ST = mkBaseModule (fsLit "GHC.ST")
430 gHC_ARR = mkBaseModule (fsLit "GHC.Arr")
431 gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
432 gHC_PTR = mkBaseModule (fsLit "GHC.Ptr")
433 gHC_ERR = mkBaseModule (fsLit "GHC.Err")
434 gHC_REAL = mkBaseModule (fsLit "GHC.Real")
435 gHC_FLOAT = mkBaseModule (fsLit "GHC.Float")
436 gHC_TOP_HANDLER = mkBaseModule (fsLit "GHC.TopHandler")
437 sYSTEM_IO = mkBaseModule (fsLit "System.IO")
438 dYNAMIC = mkBaseModule (fsLit "Data.Dynamic")
439 tYPEABLE = mkBaseModule (fsLit "Data.Typeable")
440 tYPEABLE_INTERNAL = mkBaseModule (fsLit "Data.Typeable.Internal")
441 gENERICS = mkBaseModule (fsLit "Data.Data")
442 rEAD_PREC = mkBaseModule (fsLit "Text.ParserCombinators.ReadPrec")
443 lEX = mkBaseModule (fsLit "Text.Read.Lex")
444 gHC_INT = mkBaseModule (fsLit "GHC.Int")
445 gHC_WORD = mkBaseModule (fsLit "GHC.Word")
446 mONAD = mkBaseModule (fsLit "Control.Monad")
447 mONAD_FIX = mkBaseModule (fsLit "Control.Monad.Fix")
448 mONAD_ZIP = mkBaseModule (fsLit "Control.Monad.Zip")
449 aRROW = mkBaseModule (fsLit "Control.Arrow")
450 cONTROL_APPLICATIVE = mkBaseModule (fsLit "Control.Applicative")
451 gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
452 rANDOM = mkBaseModule (fsLit "System.Random")
453 gHC_EXTS = mkBaseModule (fsLit "GHC.Exts")
454 cONTROL_EXCEPTION_BASE = mkBaseModule (fsLit "Control.Exception.Base")
455 gHC_GENERICS = mkBaseModule (fsLit "GHC.Generics")
456 gHC_TYPELITS = mkBaseModule (fsLit "GHC.TypeLits")
457
458 gHC_PARR' :: Module
459 gHC_PARR' = mkBaseModule (fsLit "GHC.PArr")
460
461 gHC_SRCLOC :: Module
462 gHC_SRCLOC = mkBaseModule (fsLit "GHC.SrcLoc")
463
464 gHC_STACK, gHC_STACK_TYPES :: Module
465 gHC_STACK = mkBaseModule (fsLit "GHC.Stack")
466 gHC_STACK_TYPES = mkBaseModule (fsLit "GHC.Stack.Types")
467
468 gHC_STATICPTR :: Module
469 gHC_STATICPTR = mkBaseModule (fsLit "GHC.StaticPtr")
470
471 gHC_FINGERPRINT_TYPE :: Module
472 gHC_FINGERPRINT_TYPE = mkBaseModule (fsLit "GHC.Fingerprint.Type")
473
474 mAIN, rOOT_MAIN :: Module
475 mAIN = mkMainModule_ mAIN_NAME
476 rOOT_MAIN = mkMainModule (fsLit ":Main") -- Root module for initialisation
477
478 mkInteractiveModule :: Int -> Module
479 -- (mkInteractiveMoudule 9) makes module 'interactive:M9'
480 mkInteractiveModule n = mkModule interactiveUnitId (mkModuleName ("Ghci" ++ show n))
481
482 pRELUDE_NAME, mAIN_NAME :: ModuleName
483 pRELUDE_NAME = mkModuleNameFS (fsLit "Prelude")
484 mAIN_NAME = mkModuleNameFS (fsLit "Main")
485
486 dATA_ARRAY_PARALLEL_NAME, dATA_ARRAY_PARALLEL_PRIM_NAME :: ModuleName
487 dATA_ARRAY_PARALLEL_NAME = mkModuleNameFS (fsLit "Data.Array.Parallel")
488 dATA_ARRAY_PARALLEL_PRIM_NAME = mkModuleNameFS (fsLit "Data.Array.Parallel.Prim")
489
490 mkPrimModule :: FastString -> Module
491 mkPrimModule m = mkModule primUnitId (mkModuleNameFS m)
492
493 mkIntegerModule :: FastString -> Module
494 mkIntegerModule m = mkModule integerUnitId (mkModuleNameFS m)
495
496 mkBaseModule :: FastString -> Module
497 mkBaseModule m = mkModule baseUnitId (mkModuleNameFS m)
498
499 mkBaseModule_ :: ModuleName -> Module
500 mkBaseModule_ m = mkModule baseUnitId m
501
502 mkThisGhcModule :: FastString -> Module
503 mkThisGhcModule m = mkModule thisGhcUnitId (mkModuleNameFS m)
504
505 mkThisGhcModule_ :: ModuleName -> Module
506 mkThisGhcModule_ m = mkModule thisGhcUnitId m
507
508 mkMainModule :: FastString -> Module
509 mkMainModule m = mkModule mainUnitId (mkModuleNameFS m)
510
511 mkMainModule_ :: ModuleName -> Module
512 mkMainModule_ m = mkModule mainUnitId m
513
514 {-
515 ************************************************************************
516 * *
517 RdrNames
518 * *
519 ************************************************************************
520 -}
521
522 main_RDR_Unqual :: RdrName
523 main_RDR_Unqual = mkUnqual varName (fsLit "main")
524 -- We definitely don't want an Orig RdrName, because
525 -- main might, in principle, be imported into module Main
526
527 forall_tv_RDR, dot_tv_RDR :: RdrName
528 forall_tv_RDR = mkUnqual tvName (fsLit "forall")
529 dot_tv_RDR = mkUnqual tvName (fsLit ".")
530
531 eq_RDR, ge_RDR, ne_RDR, le_RDR, lt_RDR, gt_RDR, compare_RDR,
532 ltTag_RDR, eqTag_RDR, gtTag_RDR :: RdrName
533 eq_RDR = nameRdrName eqName
534 ge_RDR = nameRdrName geName
535 ne_RDR = varQual_RDR gHC_CLASSES (fsLit "/=")
536 le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=")
537 lt_RDR = varQual_RDR gHC_CLASSES (fsLit "<")
538 gt_RDR = varQual_RDR gHC_CLASSES (fsLit ">")
539 compare_RDR = varQual_RDR gHC_CLASSES (fsLit "compare")
540 ltTag_RDR = dataQual_RDR gHC_TYPES (fsLit "LT")
541 eqTag_RDR = dataQual_RDR gHC_TYPES (fsLit "EQ")
542 gtTag_RDR = dataQual_RDR gHC_TYPES (fsLit "GT")
543
544 eqClass_RDR, numClass_RDR, ordClass_RDR, enumClass_RDR, monadClass_RDR
545 :: RdrName
546 eqClass_RDR = nameRdrName eqClassName
547 numClass_RDR = nameRdrName numClassName
548 ordClass_RDR = nameRdrName ordClassName
549 enumClass_RDR = nameRdrName enumClassName
550 monadClass_RDR = nameRdrName monadClassName
551
552 map_RDR, append_RDR :: RdrName
553 map_RDR = varQual_RDR gHC_BASE (fsLit "map")
554 append_RDR = varQual_RDR gHC_BASE (fsLit "++")
555
556 foldr_RDR, build_RDR, returnM_RDR, bindM_RDR, failM_RDR :: RdrName
557 foldr_RDR = nameRdrName foldrName
558 build_RDR = nameRdrName buildName
559 returnM_RDR = nameRdrName returnMName
560 bindM_RDR = nameRdrName bindMName
561 failM_RDR = nameRdrName failMName
562
563 left_RDR, right_RDR :: RdrName
564 left_RDR = nameRdrName leftDataConName
565 right_RDR = nameRdrName rightDataConName
566
567 fromEnum_RDR, toEnum_RDR :: RdrName
568 fromEnum_RDR = varQual_RDR gHC_ENUM (fsLit "fromEnum")
569 toEnum_RDR = varQual_RDR gHC_ENUM (fsLit "toEnum")
570
571 enumFrom_RDR, enumFromTo_RDR, enumFromThen_RDR, enumFromThenTo_RDR :: RdrName
572 enumFrom_RDR = nameRdrName enumFromName
573 enumFromTo_RDR = nameRdrName enumFromToName
574 enumFromThen_RDR = nameRdrName enumFromThenName
575 enumFromThenTo_RDR = nameRdrName enumFromThenToName
576
577 ratioDataCon_RDR, plusInteger_RDR, timesInteger_RDR :: RdrName
578 ratioDataCon_RDR = nameRdrName ratioDataConName
579 plusInteger_RDR = nameRdrName plusIntegerName
580 timesInteger_RDR = nameRdrName timesIntegerName
581
582 ioDataCon_RDR :: RdrName
583 ioDataCon_RDR = nameRdrName ioDataConName
584
585 eqString_RDR, unpackCString_RDR, unpackCStringFoldr_RDR,
586 unpackCStringUtf8_RDR :: RdrName
587 eqString_RDR = nameRdrName eqStringName
588 unpackCString_RDR = nameRdrName unpackCStringName
589 unpackCStringFoldr_RDR = nameRdrName unpackCStringFoldrName
590 unpackCStringUtf8_RDR = nameRdrName unpackCStringUtf8Name
591
592 newStablePtr_RDR :: RdrName
593 newStablePtr_RDR = nameRdrName newStablePtrName
594
595 bindIO_RDR, returnIO_RDR :: RdrName
596 bindIO_RDR = nameRdrName bindIOName
597 returnIO_RDR = nameRdrName returnIOName
598
599 fromInteger_RDR, fromRational_RDR, minus_RDR, times_RDR, plus_RDR :: RdrName
600 fromInteger_RDR = nameRdrName fromIntegerName
601 fromRational_RDR = nameRdrName fromRationalName
602 minus_RDR = nameRdrName minusName
603 times_RDR = varQual_RDR gHC_NUM (fsLit "*")
604 plus_RDR = varQual_RDR gHC_NUM (fsLit "+")
605
606 toInteger_RDR, toRational_RDR, fromIntegral_RDR :: RdrName
607 toInteger_RDR = nameRdrName toIntegerName
608 toRational_RDR = nameRdrName toRationalName
609 fromIntegral_RDR = nameRdrName fromIntegralName
610
611 stringTy_RDR, fromString_RDR :: RdrName
612 stringTy_RDR = tcQual_RDR gHC_BASE (fsLit "String")
613 fromString_RDR = nameRdrName fromStringName
614
615 fromList_RDR, fromListN_RDR, toList_RDR :: RdrName
616 fromList_RDR = nameRdrName fromListName
617 fromListN_RDR = nameRdrName fromListNName
618 toList_RDR = nameRdrName toListName
619
620 compose_RDR :: RdrName
621 compose_RDR = varQual_RDR gHC_BASE (fsLit ".")
622
623 not_RDR, getTag_RDR, succ_RDR, pred_RDR, minBound_RDR, maxBound_RDR,
624 and_RDR, range_RDR, inRange_RDR, index_RDR,
625 unsafeIndex_RDR, unsafeRangeSize_RDR :: RdrName
626 and_RDR = varQual_RDR gHC_CLASSES (fsLit "&&")
627 not_RDR = varQual_RDR gHC_CLASSES (fsLit "not")
628 getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag")
629 succ_RDR = varQual_RDR gHC_ENUM (fsLit "succ")
630 pred_RDR = varQual_RDR gHC_ENUM (fsLit "pred")
631 minBound_RDR = varQual_RDR gHC_ENUM (fsLit "minBound")
632 maxBound_RDR = varQual_RDR gHC_ENUM (fsLit "maxBound")
633 range_RDR = varQual_RDR gHC_ARR (fsLit "range")
634 inRange_RDR = varQual_RDR gHC_ARR (fsLit "inRange")
635 index_RDR = varQual_RDR gHC_ARR (fsLit "index")
636 unsafeIndex_RDR = varQual_RDR gHC_ARR (fsLit "unsafeIndex")
637 unsafeRangeSize_RDR = varQual_RDR gHC_ARR (fsLit "unsafeRangeSize")
638
639 readList_RDR, readListDefault_RDR, readListPrec_RDR, readListPrecDefault_RDR,
640 readPrec_RDR, parens_RDR, choose_RDR, lexP_RDR, expectP_RDR :: RdrName
641 readList_RDR = varQual_RDR gHC_READ (fsLit "readList")
642 readListDefault_RDR = varQual_RDR gHC_READ (fsLit "readListDefault")
643 readListPrec_RDR = varQual_RDR gHC_READ (fsLit "readListPrec")
644 readListPrecDefault_RDR = varQual_RDR gHC_READ (fsLit "readListPrecDefault")
645 readPrec_RDR = varQual_RDR gHC_READ (fsLit "readPrec")
646 parens_RDR = varQual_RDR gHC_READ (fsLit "parens")
647 choose_RDR = varQual_RDR gHC_READ (fsLit "choose")
648 lexP_RDR = varQual_RDR gHC_READ (fsLit "lexP")
649 expectP_RDR = varQual_RDR gHC_READ (fsLit "expectP")
650
651 punc_RDR, ident_RDR, symbol_RDR :: RdrName
652 punc_RDR = dataQual_RDR lEX (fsLit "Punc")
653 ident_RDR = dataQual_RDR lEX (fsLit "Ident")
654 symbol_RDR = dataQual_RDR lEX (fsLit "Symbol")
655
656 step_RDR, alt_RDR, reset_RDR, prec_RDR, pfail_RDR :: RdrName
657 step_RDR = varQual_RDR rEAD_PREC (fsLit "step")
658 alt_RDR = varQual_RDR rEAD_PREC (fsLit "+++")
659 reset_RDR = varQual_RDR rEAD_PREC (fsLit "reset")
660 prec_RDR = varQual_RDR rEAD_PREC (fsLit "prec")
661 pfail_RDR = varQual_RDR rEAD_PREC (fsLit "pfail")
662
663 showList_RDR, showList___RDR, showsPrec_RDR, shows_RDR, showString_RDR,
664 showSpace_RDR, showParen_RDR :: RdrName
665 showList_RDR = varQual_RDR gHC_SHOW (fsLit "showList")
666 showList___RDR = varQual_RDR gHC_SHOW (fsLit "showList__")
667 showsPrec_RDR = varQual_RDR gHC_SHOW (fsLit "showsPrec")
668 shows_RDR = varQual_RDR gHC_SHOW (fsLit "shows")
669 showString_RDR = varQual_RDR gHC_SHOW (fsLit "showString")
670 showSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showSpace")
671 showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen")
672
673 undefined_RDR :: RdrName
674 undefined_RDR = varQual_RDR gHC_ERR (fsLit "undefined")
675
676 error_RDR :: RdrName
677 error_RDR = varQual_RDR gHC_ERR (fsLit "error")
678
679 -- Generics (constructors and functions)
680 u1DataCon_RDR, par1DataCon_RDR, rec1DataCon_RDR,
681 k1DataCon_RDR, m1DataCon_RDR, l1DataCon_RDR, r1DataCon_RDR,
682 prodDataCon_RDR, comp1DataCon_RDR,
683 unPar1_RDR, unRec1_RDR, unK1_RDR, unComp1_RDR,
684 from_RDR, from1_RDR, to_RDR, to1_RDR,
685 datatypeName_RDR, moduleName_RDR, packageName_RDR, isNewtypeName_RDR,
686 conName_RDR, conFixity_RDR, conIsRecord_RDR,
687 noArityDataCon_RDR, arityDataCon_RDR, selName_RDR,
688 prefixDataCon_RDR, infixDataCon_RDR, leftAssocDataCon_RDR,
689 rightAssocDataCon_RDR, notAssocDataCon_RDR,
690 uAddrDataCon_RDR, uCharDataCon_RDR, uDoubleDataCon_RDR,
691 uFloatDataCon_RDR, uIntDataCon_RDR, uWordDataCon_RDR,
692 uAddrHash_RDR, uCharHash_RDR, uDoubleHash_RDR,
693 uFloatHash_RDR, uIntHash_RDR, uWordHash_RDR :: RdrName
694
695 u1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "U1")
696 par1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Par1")
697 rec1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Rec1")
698 k1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "K1")
699 m1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "M1")
700
701 l1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "L1")
702 r1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "R1")
703
704 prodDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit ":*:")
705 comp1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Comp1")
706
707 unPar1_RDR = varQual_RDR gHC_GENERICS (fsLit "unPar1")
708 unRec1_RDR = varQual_RDR gHC_GENERICS (fsLit "unRec1")
709 unK1_RDR = varQual_RDR gHC_GENERICS (fsLit "unK1")
710 unComp1_RDR = varQual_RDR gHC_GENERICS (fsLit "unComp1")
711
712 from_RDR = varQual_RDR gHC_GENERICS (fsLit "from")
713 from1_RDR = varQual_RDR gHC_GENERICS (fsLit "from1")
714 to_RDR = varQual_RDR gHC_GENERICS (fsLit "to")
715 to1_RDR = varQual_RDR gHC_GENERICS (fsLit "to1")
716
717 datatypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "datatypeName")
718 moduleName_RDR = varQual_RDR gHC_GENERICS (fsLit "moduleName")
719 packageName_RDR = varQual_RDR gHC_GENERICS (fsLit "packageName")
720 isNewtypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "isNewtype")
721 selName_RDR = varQual_RDR gHC_GENERICS (fsLit "selName")
722 conName_RDR = varQual_RDR gHC_GENERICS (fsLit "conName")
723 conFixity_RDR = varQual_RDR gHC_GENERICS (fsLit "conFixity")
724 conIsRecord_RDR = varQual_RDR gHC_GENERICS (fsLit "conIsRecord")
725
726 noArityDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "NoArity")
727 arityDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Arity")
728 prefixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Prefix")
729 infixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Infix")
730 leftAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "LeftAssociative")
731 rightAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "RightAssociative")
732 notAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "NotAssociative")
733
734 uAddrDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UAddr")
735 uCharDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UChar")
736 uDoubleDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UDouble")
737 uFloatDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UFloat")
738 uIntDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UInt")
739 uWordDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UWord")
740
741 uAddrHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uAddr#")
742 uCharHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uChar#")
743 uDoubleHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uDouble#")
744 uFloatHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uFloat#")
745 uIntHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uInt#")
746 uWordHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uWord#")
747
748 fmap_RDR, pure_RDR, ap_RDR, foldable_foldr_RDR, foldMap_RDR,
749 traverse_RDR, mempty_RDR, mappend_RDR :: RdrName
750 fmap_RDR = varQual_RDR gHC_BASE (fsLit "fmap")
751 pure_RDR = nameRdrName pureAName
752 ap_RDR = nameRdrName apAName
753 foldable_foldr_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldr")
754 foldMap_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldMap")
755 traverse_RDR = varQual_RDR dATA_TRAVERSABLE (fsLit "traverse")
756 mempty_RDR = varQual_RDR gHC_BASE (fsLit "mempty")
757 mappend_RDR = varQual_RDR gHC_BASE (fsLit "mappend")
758
759 ----------------------
760 varQual_RDR, tcQual_RDR, clsQual_RDR, dataQual_RDR
761 :: Module -> FastString -> RdrName
762 varQual_RDR mod str = mkOrig mod (mkOccNameFS varName str)
763 tcQual_RDR mod str = mkOrig mod (mkOccNameFS tcName str)
764 clsQual_RDR mod str = mkOrig mod (mkOccNameFS clsName str)
765 dataQual_RDR mod str = mkOrig mod (mkOccNameFS dataName str)
766
767 {-
768 ************************************************************************
769 * *
770 \subsection{Known-key names}
771 * *
772 ************************************************************************
773
774 Many of these Names are not really "built in", but some parts of the
775 compiler (notably the deriving mechanism) need to mention their names,
776 and it's convenient to write them all down in one place.
777
778 --MetaHaskell Extension add the constrs and the lower case case
779 -- guys as well (perhaps) e.g. see trueDataConName below
780 -}
781
782 -- | Build a 'Name' for the 'Typeable' representation of the given special 'TyCon'.
783 -- Special 'TyCon's include @(->)@, @BOX@, @Constraint@, etc. See 'TysPrim'.
784 mkSpecialTyConRepName :: FastString -> Name -> Name
785 -- See Note [Grand plan for Typeable] in 'TcTypeable' in TcTypeable.
786 mkSpecialTyConRepName fs tc_name
787 = mkExternalName (tyConRepNameUnique (nameUnique tc_name))
788 tYPEABLE_INTERNAL
789 (mkVarOccFS fs)
790 wiredInSrcSpan
791
792 -- | Make a 'Name' for the 'Typeable' representation of the given wired-in type
793 mkPrelTyConRepName :: Name -> Name
794 -- See Note [Grand plan for Typeable] in 'TcTypeable' in TcTypeable.
795 mkPrelTyConRepName tc_name -- Prelude tc_name is always External,
796 -- so nameModule will work
797 = mkExternalName rep_uniq rep_mod rep_occ (nameSrcSpan tc_name)
798 where
799 name_occ = nameOccName tc_name
800 name_mod = nameModule tc_name
801 name_uniq = nameUnique tc_name
802 rep_uniq | isTcOcc name_occ = tyConRepNameUnique name_uniq
803 | otherwise = dataConRepNameUnique name_uniq
804 (rep_mod, rep_occ) = tyConRepModOcc name_mod name_occ
805
806 -- | TODO
807 -- See Note [Grand plan for Typeable] in 'TcTypeable' in TcTypeable.
808 tyConRepModOcc :: Module -> OccName -> (Module, OccName)
809 tyConRepModOcc tc_module tc_occ
810 | tc_module == gHC_TYPES
811 = (tYPEABLE_INTERNAL, mkTyConRepUserOcc tc_occ)
812 | otherwise
813 = (tc_module, mkTyConRepSysOcc tc_occ)
814
815 wildCardName :: Name
816 wildCardName = mkSystemVarName wildCardKey (fsLit "wild")
817
818 runMainIOName :: Name
819 runMainIOName = varQual gHC_TOP_HANDLER (fsLit "runMainIO") runMainKey
820
821 orderingTyConName, ltDataConName, eqDataConName, gtDataConName :: Name
822 orderingTyConName = tcQual gHC_TYPES (fsLit "Ordering") orderingTyConKey
823 ltDataConName = dcQual gHC_TYPES (fsLit "LT") ltDataConKey
824 eqDataConName = dcQual gHC_TYPES (fsLit "EQ") eqDataConKey
825 gtDataConName = dcQual gHC_TYPES (fsLit "GT") gtDataConKey
826
827 specTyConName :: Name
828 specTyConName = tcQual gHC_TYPES (fsLit "SPEC") specTyConKey
829
830 eitherTyConName, leftDataConName, rightDataConName :: Name
831 eitherTyConName = tcQual dATA_EITHER (fsLit "Either") eitherTyConKey
832 leftDataConName = dcQual dATA_EITHER (fsLit "Left") leftDataConKey
833 rightDataConName = dcQual dATA_EITHER (fsLit "Right") rightDataConKey
834
835 -- Generics (types)
836 v1TyConName, u1TyConName, par1TyConName, rec1TyConName,
837 k1TyConName, m1TyConName, sumTyConName, prodTyConName,
838 compTyConName, rTyConName, pTyConName, dTyConName,
839 cTyConName, sTyConName, rec0TyConName, par0TyConName,
840 d1TyConName, c1TyConName, s1TyConName, noSelTyConName,
841 repTyConName, rep1TyConName, uRecTyConName,
842 uAddrTyConName, uCharTyConName, uDoubleTyConName,
843 uFloatTyConName, uIntTyConName, uWordTyConName :: Name
844
845 v1TyConName = tcQual gHC_GENERICS (fsLit "V1") v1TyConKey
846 u1TyConName = tcQual gHC_GENERICS (fsLit "U1") u1TyConKey
847 par1TyConName = tcQual gHC_GENERICS (fsLit "Par1") par1TyConKey
848 rec1TyConName = tcQual gHC_GENERICS (fsLit "Rec1") rec1TyConKey
849 k1TyConName = tcQual gHC_GENERICS (fsLit "K1") k1TyConKey
850 m1TyConName = tcQual gHC_GENERICS (fsLit "M1") m1TyConKey
851
852 sumTyConName = tcQual gHC_GENERICS (fsLit ":+:") sumTyConKey
853 prodTyConName = tcQual gHC_GENERICS (fsLit ":*:") prodTyConKey
854 compTyConName = tcQual gHC_GENERICS (fsLit ":.:") compTyConKey
855
856 rTyConName = tcQual gHC_GENERICS (fsLit "R") rTyConKey
857 pTyConName = tcQual gHC_GENERICS (fsLit "P") pTyConKey
858 dTyConName = tcQual gHC_GENERICS (fsLit "D") dTyConKey
859 cTyConName = tcQual gHC_GENERICS (fsLit "C") cTyConKey
860 sTyConName = tcQual gHC_GENERICS (fsLit "S") sTyConKey
861
862 rec0TyConName = tcQual gHC_GENERICS (fsLit "Rec0") rec0TyConKey
863 par0TyConName = tcQual gHC_GENERICS (fsLit "Par0") par0TyConKey
864 d1TyConName = tcQual gHC_GENERICS (fsLit "D1") d1TyConKey
865 c1TyConName = tcQual gHC_GENERICS (fsLit "C1") c1TyConKey
866 s1TyConName = tcQual gHC_GENERICS (fsLit "S1") s1TyConKey
867 noSelTyConName = tcQual gHC_GENERICS (fsLit "NoSelector") noSelTyConKey
868
869 repTyConName = tcQual gHC_GENERICS (fsLit "Rep") repTyConKey
870 rep1TyConName = tcQual gHC_GENERICS (fsLit "Rep1") rep1TyConKey
871
872 uRecTyConName = tcQual gHC_GENERICS (fsLit "URec") uRecTyConKey
873 uAddrTyConName = tcQual gHC_GENERICS (fsLit "UAddr") uAddrTyConKey
874 uCharTyConName = tcQual gHC_GENERICS (fsLit "UChar") uCharTyConKey
875 uDoubleTyConName = tcQual gHC_GENERICS (fsLit "UDouble") uDoubleTyConKey
876 uFloatTyConName = tcQual gHC_GENERICS (fsLit "UFloat") uFloatTyConKey
877 uIntTyConName = tcQual gHC_GENERICS (fsLit "UInt") uIntTyConKey
878 uWordTyConName = tcQual gHC_GENERICS (fsLit "UWord") uWordTyConKey
879
880 -- Base strings Strings
881 unpackCStringName, unpackCStringFoldrName,
882 unpackCStringUtf8Name, eqStringName :: Name
883 unpackCStringName = varQual gHC_CSTRING (fsLit "unpackCString#") unpackCStringIdKey
884 unpackCStringFoldrName = varQual gHC_CSTRING (fsLit "unpackFoldrCString#") unpackCStringFoldrIdKey
885 unpackCStringUtf8Name = varQual gHC_CSTRING (fsLit "unpackCStringUtf8#") unpackCStringUtf8IdKey
886 eqStringName = varQual gHC_BASE (fsLit "eqString") eqStringIdKey
887
888 -- The 'inline' function
889 inlineIdName :: Name
890 inlineIdName = varQual gHC_MAGIC (fsLit "inline") inlineIdKey
891
892 -- Base classes (Eq, Ord, Functor)
893 fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name
894 eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey
895 eqName = varQual gHC_CLASSES (fsLit "==") eqClassOpKey
896 ordClassName = clsQual gHC_CLASSES (fsLit "Ord") ordClassKey
897 geName = varQual gHC_CLASSES (fsLit ">=") geClassOpKey
898 functorClassName = clsQual gHC_BASE (fsLit "Functor") functorClassKey
899 fmapName = varQual gHC_BASE (fsLit "fmap") fmapClassOpKey
900
901 -- Class Monad
902 monadClassName, thenMName, bindMName, returnMName, failMName :: Name
903 monadClassName = clsQual gHC_BASE (fsLit "Monad") monadClassKey
904 thenMName = varQual gHC_BASE (fsLit ">>") thenMClassOpKey
905 bindMName = varQual gHC_BASE (fsLit ">>=") bindMClassOpKey
906 returnMName = varQual gHC_BASE (fsLit "return") returnMClassOpKey
907 failMName = varQual gHC_BASE (fsLit "fail") failMClassOpKey
908
909 -- Classes (Applicative, Foldable, Traversable)
910 applicativeClassName, foldableClassName, traversableClassName :: Name
911 applicativeClassName = clsQual gHC_BASE (fsLit "Applicative") applicativeClassKey
912 foldableClassName = clsQual dATA_FOLDABLE (fsLit "Foldable") foldableClassKey
913 traversableClassName = clsQual dATA_TRAVERSABLE (fsLit "Traversable") traversableClassKey
914
915
916
917 -- AMP additions
918
919 joinMName, apAName, pureAName, alternativeClassName :: Name
920 joinMName = varQual gHC_BASE (fsLit "join") joinMIdKey
921 apAName = varQual gHC_BASE (fsLit "<*>") apAClassOpKey
922 pureAName = varQual gHC_BASE (fsLit "pure") pureAClassOpKey
923 alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey
924
925 joinMIdKey, apAClassOpKey, pureAClassOpKey, alternativeClassKey :: Unique
926 joinMIdKey = mkPreludeMiscIdUnique 750
927 apAClassOpKey = mkPreludeMiscIdUnique 751 -- <*>
928 pureAClassOpKey = mkPreludeMiscIdUnique 752
929 alternativeClassKey = mkPreludeMiscIdUnique 753
930
931
932 -- Functions for GHC extensions
933 groupWithName :: Name
934 groupWithName = varQual gHC_EXTS (fsLit "groupWith") groupWithIdKey
935
936 -- Random PrelBase functions
937 fromStringName, otherwiseIdName, foldrName, buildName, augmentName,
938 mapName, appendName, assertName,
939 breakpointName, breakpointCondName, breakpointAutoName,
940 opaqueTyConName :: Name
941 fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
942 otherwiseIdName = varQual gHC_BASE (fsLit "otherwise") otherwiseIdKey
943 foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey
944 buildName = varQual gHC_BASE (fsLit "build") buildIdKey
945 augmentName = varQual gHC_BASE (fsLit "augment") augmentIdKey
946 mapName = varQual gHC_BASE (fsLit "map") mapIdKey
947 appendName = varQual gHC_BASE (fsLit "++") appendIdKey
948 assertName = varQual gHC_BASE (fsLit "assert") assertIdKey
949 breakpointName = varQual gHC_BASE (fsLit "breakpoint") breakpointIdKey
950 breakpointCondName= varQual gHC_BASE (fsLit "breakpointCond") breakpointCondIdKey
951 breakpointAutoName= varQual gHC_BASE (fsLit "breakpointAuto") breakpointAutoIdKey
952 opaqueTyConName = tcQual gHC_BASE (fsLit "Opaque") opaqueTyConKey
953
954 breakpointJumpName :: Name
955 breakpointJumpName
956 = mkInternalName
957 breakpointJumpIdKey
958 (mkOccNameFS varName (fsLit "breakpointJump"))
959 noSrcSpan
960 breakpointCondJumpName :: Name
961 breakpointCondJumpName
962 = mkInternalName
963 breakpointCondJumpIdKey
964 (mkOccNameFS varName (fsLit "breakpointCondJump"))
965 noSrcSpan
966 breakpointAutoJumpName :: Name
967 breakpointAutoJumpName
968 = mkInternalName
969 breakpointAutoJumpIdKey
970 (mkOccNameFS varName (fsLit "breakpointAutoJump"))
971 noSrcSpan
972
973 -- PrelTup
974 fstName, sndName :: Name
975 fstName = varQual dATA_TUPLE (fsLit "fst") fstIdKey
976 sndName = varQual dATA_TUPLE (fsLit "snd") sndIdKey
977
978 -- Module GHC.Num
979 numClassName, fromIntegerName, minusName, negateName :: Name
980 numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey
981 fromIntegerName = varQual gHC_NUM (fsLit "fromInteger") fromIntegerClassOpKey
982 minusName = varQual gHC_NUM (fsLit "-") minusClassOpKey
983 negateName = varQual gHC_NUM (fsLit "negate") negateClassOpKey
984
985 integerTyConName, mkIntegerName, integerSDataConName,
986 integerToWord64Name, integerToInt64Name,
987 word64ToIntegerName, int64ToIntegerName,
988 plusIntegerName, timesIntegerName, smallIntegerName,
989 wordToIntegerName,
990 integerToWordName, integerToIntName, minusIntegerName,
991 negateIntegerName, eqIntegerPrimName, neqIntegerPrimName,
992 absIntegerName, signumIntegerName,
993 leIntegerPrimName, gtIntegerPrimName, ltIntegerPrimName, geIntegerPrimName,
994 compareIntegerName, quotRemIntegerName, divModIntegerName,
995 quotIntegerName, remIntegerName, divIntegerName, modIntegerName,
996 floatFromIntegerName, doubleFromIntegerName,
997 encodeFloatIntegerName, encodeDoubleIntegerName,
998 decodeDoubleIntegerName,
999 gcdIntegerName, lcmIntegerName,
1000 andIntegerName, orIntegerName, xorIntegerName, complementIntegerName,
1001 shiftLIntegerName, shiftRIntegerName, bitIntegerName :: Name
1002 integerTyConName = tcQual gHC_INTEGER_TYPE (fsLit "Integer") integerTyConKey
1003 integerSDataConName = dcQual gHC_INTEGER_TYPE (fsLit n) integerSDataConKey
1004 where n = case cIntegerLibraryType of
1005 IntegerGMP -> "S#"
1006 IntegerSimple -> panic "integerSDataConName evaluated for integer-simple"
1007 mkIntegerName = varQual gHC_INTEGER_TYPE (fsLit "mkInteger") mkIntegerIdKey
1008 integerToWord64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToWord64") integerToWord64IdKey
1009 integerToInt64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToInt64") integerToInt64IdKey
1010 word64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "word64ToInteger") word64ToIntegerIdKey
1011 int64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "int64ToInteger") int64ToIntegerIdKey
1012 plusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "plusInteger") plusIntegerIdKey
1013 timesIntegerName = varQual gHC_INTEGER_TYPE (fsLit "timesInteger") timesIntegerIdKey
1014 smallIntegerName = varQual gHC_INTEGER_TYPE (fsLit "smallInteger") smallIntegerIdKey
1015 wordToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "wordToInteger") wordToIntegerIdKey
1016 integerToWordName = varQual gHC_INTEGER_TYPE (fsLit "integerToWord") integerToWordIdKey
1017 integerToIntName = varQual gHC_INTEGER_TYPE (fsLit "integerToInt") integerToIntIdKey
1018 minusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "minusInteger") minusIntegerIdKey
1019 negateIntegerName = varQual gHC_INTEGER_TYPE (fsLit "negateInteger") negateIntegerIdKey
1020 eqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "eqInteger#") eqIntegerPrimIdKey
1021 neqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "neqInteger#") neqIntegerPrimIdKey
1022 absIntegerName = varQual gHC_INTEGER_TYPE (fsLit "absInteger") absIntegerIdKey
1023 signumIntegerName = varQual gHC_INTEGER_TYPE (fsLit "signumInteger") signumIntegerIdKey
1024 leIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "leInteger#") leIntegerPrimIdKey
1025 gtIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "gtInteger#") gtIntegerPrimIdKey
1026 ltIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "ltInteger#") ltIntegerPrimIdKey
1027 geIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "geInteger#") geIntegerPrimIdKey
1028 compareIntegerName = varQual gHC_INTEGER_TYPE (fsLit "compareInteger") compareIntegerIdKey
1029 quotRemIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotRemInteger") quotRemIntegerIdKey
1030 divModIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divModInteger") divModIntegerIdKey
1031 quotIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotInteger") quotIntegerIdKey
1032 remIntegerName = varQual gHC_INTEGER_TYPE (fsLit "remInteger") remIntegerIdKey
1033 divIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divInteger") divIntegerIdKey
1034 modIntegerName = varQual gHC_INTEGER_TYPE (fsLit "modInteger") modIntegerIdKey
1035 floatFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "floatFromInteger") floatFromIntegerIdKey
1036 doubleFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "doubleFromInteger") doubleFromIntegerIdKey
1037 encodeFloatIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeFloatInteger") encodeFloatIntegerIdKey
1038 encodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeDoubleInteger") encodeDoubleIntegerIdKey
1039 decodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "decodeDoubleInteger") decodeDoubleIntegerIdKey
1040 gcdIntegerName = varQual gHC_INTEGER_TYPE (fsLit "gcdInteger") gcdIntegerIdKey
1041 lcmIntegerName = varQual gHC_INTEGER_TYPE (fsLit "lcmInteger") lcmIntegerIdKey
1042 andIntegerName = varQual gHC_INTEGER_TYPE (fsLit "andInteger") andIntegerIdKey
1043 orIntegerName = varQual gHC_INTEGER_TYPE (fsLit "orInteger") orIntegerIdKey
1044 xorIntegerName = varQual gHC_INTEGER_TYPE (fsLit "xorInteger") xorIntegerIdKey
1045 complementIntegerName = varQual gHC_INTEGER_TYPE (fsLit "complementInteger") complementIntegerIdKey
1046 shiftLIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftLInteger") shiftLIntegerIdKey
1047 shiftRIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftRInteger") shiftRIntegerIdKey
1048 bitIntegerName = varQual gHC_INTEGER_TYPE (fsLit "bitInteger") bitIntegerIdKey
1049
1050 -- GHC.Real types and classes
1051 rationalTyConName, ratioTyConName, ratioDataConName, realClassName,
1052 integralClassName, realFracClassName, fractionalClassName,
1053 fromRationalName, toIntegerName, toRationalName, fromIntegralName,
1054 realToFracName :: Name
1055 rationalTyConName = tcQual gHC_REAL (fsLit "Rational") rationalTyConKey
1056 ratioTyConName = tcQual gHC_REAL (fsLit "Ratio") ratioTyConKey
1057 ratioDataConName = dcQual gHC_REAL (fsLit ":%") ratioDataConKey
1058 realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey
1059 integralClassName = clsQual gHC_REAL (fsLit "Integral") integralClassKey
1060 realFracClassName = clsQual gHC_REAL (fsLit "RealFrac") realFracClassKey
1061 fractionalClassName = clsQual gHC_REAL (fsLit "Fractional") fractionalClassKey
1062 fromRationalName = varQual gHC_REAL (fsLit "fromRational") fromRationalClassOpKey
1063 toIntegerName = varQual gHC_REAL (fsLit "toInteger") toIntegerClassOpKey
1064 toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey
1065 fromIntegralName = varQual gHC_REAL (fsLit "fromIntegral")fromIntegralIdKey
1066 realToFracName = varQual gHC_REAL (fsLit "realToFrac") realToFracIdKey
1067
1068 -- PrelFloat classes
1069 floatingClassName, realFloatClassName :: Name
1070 floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey
1071 realFloatClassName = clsQual gHC_FLOAT (fsLit "RealFloat") realFloatClassKey
1072
1073 -- other GHC.Float functions
1074 rationalToFloatName, rationalToDoubleName :: Name
1075 rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey
1076 rationalToDoubleName = varQual gHC_FLOAT (fsLit "rationalToDouble") rationalToDoubleIdKey
1077
1078 -- Class Ix
1079 ixClassName :: Name
1080 ixClassName = clsQual gHC_ARR (fsLit "Ix") ixClassKey
1081
1082 -- Class Typeable, and functions for constructing `Typeable` dictionaries
1083 typeableClassName
1084 , typeRepTyConName
1085 , trTyConDataConName
1086 , trModuleDataConName
1087 , trNameSDataConName
1088 , mkPolyTyConAppName
1089 , mkAppTyName
1090 , typeRepIdName
1091 , typeNatTypeRepName
1092 , typeSymbolTypeRepName
1093 :: Name
1094 typeableClassName = clsQual tYPEABLE_INTERNAL (fsLit "Typeable") typeableClassKey
1095 typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey
1096 trTyConDataConName = dcQual gHC_TYPES (fsLit "TyCon") trTyConDataConKey
1097 trModuleDataConName = dcQual gHC_TYPES (fsLit "Module") trModuleDataConKey
1098 trNameSDataConName = dcQual gHC_TYPES (fsLit "TrNameS") trNameSDataConKey
1099 typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
1100 mkPolyTyConAppName = varQual tYPEABLE_INTERNAL (fsLit "mkPolyTyConApp") mkPolyTyConAppKey
1101 mkAppTyName = varQual tYPEABLE_INTERNAL (fsLit "mkAppTy") mkAppTyKey
1102 typeNatTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeNatTypeRep") typeNatTypeRepKey
1103 typeSymbolTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeSymbolTypeRep") typeSymbolTypeRepKey
1104
1105
1106 -- Dynamic
1107 toDynName :: Name
1108 toDynName = varQual dYNAMIC (fsLit "toDyn") toDynIdKey
1109
1110 -- Class Data
1111 dataClassName :: Name
1112 dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey
1113
1114 -- Error module
1115 assertErrorName :: Name
1116 assertErrorName = varQual gHC_IO_Exception (fsLit "assertError") assertErrorIdKey
1117
1118 -- Enum module (Enum, Bounded)
1119 enumClassName, enumFromName, enumFromToName, enumFromThenName,
1120 enumFromThenToName, boundedClassName :: Name
1121 enumClassName = clsQual gHC_ENUM (fsLit "Enum") enumClassKey
1122 enumFromName = varQual gHC_ENUM (fsLit "enumFrom") enumFromClassOpKey
1123 enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey
1124 enumFromThenName = varQual gHC_ENUM (fsLit "enumFromThen") enumFromThenClassOpKey
1125 enumFromThenToName = varQual gHC_ENUM (fsLit "enumFromThenTo") enumFromThenToClassOpKey
1126 boundedClassName = clsQual gHC_ENUM (fsLit "Bounded") boundedClassKey
1127
1128 -- List functions
1129 concatName, filterName, zipName :: Name
1130 concatName = varQual gHC_LIST (fsLit "concat") concatIdKey
1131 filterName = varQual gHC_LIST (fsLit "filter") filterIdKey
1132 zipName = varQual gHC_LIST (fsLit "zip") zipIdKey
1133
1134 -- Overloaded lists
1135 isListClassName, fromListName, fromListNName, toListName :: Name
1136 isListClassName = clsQual gHC_EXTS (fsLit "IsList") isListClassKey
1137 fromListName = varQual gHC_EXTS (fsLit "fromList") fromListClassOpKey
1138 fromListNName = varQual gHC_EXTS (fsLit "fromListN") fromListNClassOpKey
1139 toListName = varQual gHC_EXTS (fsLit "toList") toListClassOpKey
1140
1141 -- Class Show
1142 showClassName :: Name
1143 showClassName = clsQual gHC_SHOW (fsLit "Show") showClassKey
1144
1145 -- Class Read
1146 readClassName :: Name
1147 readClassName = clsQual gHC_READ (fsLit "Read") readClassKey
1148
1149 -- Classes Generic and Generic1, Datatype, Constructor and Selector
1150 genClassName, gen1ClassName, datatypeClassName, constructorClassName,
1151 selectorClassName :: Name
1152 genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey
1153 gen1ClassName = clsQual gHC_GENERICS (fsLit "Generic1") gen1ClassKey
1154
1155 datatypeClassName = clsQual gHC_GENERICS (fsLit "Datatype") datatypeClassKey
1156 constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey
1157 selectorClassName = clsQual gHC_GENERICS (fsLit "Selector") selectorClassKey
1158
1159 genericClassNames :: [Name]
1160 genericClassNames = [genClassName, gen1ClassName]
1161
1162 -- GHCi things
1163 ghciIoClassName, ghciStepIoMName :: Name
1164 ghciIoClassName = clsQual gHC_GHCI (fsLit "GHCiSandboxIO") ghciIoClassKey
1165 ghciStepIoMName = varQual gHC_GHCI (fsLit "ghciStepIO") ghciStepIoMClassOpKey
1166
1167 -- IO things
1168 ioTyConName, ioDataConName,
1169 thenIOName, bindIOName, returnIOName, failIOName :: Name
1170 ioTyConName = tcQual gHC_TYPES (fsLit "IO") ioTyConKey
1171 ioDataConName = dcQual gHC_TYPES (fsLit "IO") ioDataConKey
1172 thenIOName = varQual gHC_BASE (fsLit "thenIO") thenIOIdKey
1173 bindIOName = varQual gHC_BASE (fsLit "bindIO") bindIOIdKey
1174 returnIOName = varQual gHC_BASE (fsLit "returnIO") returnIOIdKey
1175 failIOName = varQual gHC_IO (fsLit "failIO") failIOIdKey
1176
1177 -- IO things
1178 printName :: Name
1179 printName = varQual sYSTEM_IO (fsLit "print") printIdKey
1180
1181 -- Int, Word, and Addr things
1182 int8TyConName, int16TyConName, int32TyConName, int64TyConName :: Name
1183 int8TyConName = tcQual gHC_INT (fsLit "Int8") int8TyConKey
1184 int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey
1185 int32TyConName = tcQual gHC_INT (fsLit "Int32") int32TyConKey
1186 int64TyConName = tcQual gHC_INT (fsLit "Int64") int64TyConKey
1187
1188 -- Word module
1189 word16TyConName, word32TyConName, word64TyConName :: Name
1190 word16TyConName = tcQual gHC_WORD (fsLit "Word16") word16TyConKey
1191 word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
1192 word64TyConName = tcQual gHC_WORD (fsLit "Word64") word64TyConKey
1193
1194 -- PrelPtr module
1195 ptrTyConName, funPtrTyConName :: Name
1196 ptrTyConName = tcQual gHC_PTR (fsLit "Ptr") ptrTyConKey
1197 funPtrTyConName = tcQual gHC_PTR (fsLit "FunPtr") funPtrTyConKey
1198
1199 -- Foreign objects and weak pointers
1200 stablePtrTyConName, newStablePtrName :: Name
1201 stablePtrTyConName = tcQual gHC_STABLE (fsLit "StablePtr") stablePtrTyConKey
1202 newStablePtrName = varQual gHC_STABLE (fsLit "newStablePtr") newStablePtrIdKey
1203
1204 -- Recursive-do notation
1205 monadFixClassName, mfixName :: Name
1206 monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey
1207 mfixName = varQual mONAD_FIX (fsLit "mfix") mfixIdKey
1208
1209 -- Arrow notation
1210 arrAName, composeAName, firstAName, appAName, choiceAName, loopAName :: Name
1211 arrAName = varQual aRROW (fsLit "arr") arrAIdKey
1212 composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey
1213 firstAName = varQual aRROW (fsLit "first") firstAIdKey
1214 appAName = varQual aRROW (fsLit "app") appAIdKey
1215 choiceAName = varQual aRROW (fsLit "|||") choiceAIdKey
1216 loopAName = varQual aRROW (fsLit "loop") loopAIdKey
1217
1218 -- Monad comprehensions
1219 guardMName, liftMName, mzipName :: Name
1220 guardMName = varQual mONAD (fsLit "guard") guardMIdKey
1221 liftMName = varQual mONAD (fsLit "liftM") liftMIdKey
1222 mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey
1223
1224
1225 -- Annotation type checking
1226 toAnnotationWrapperName :: Name
1227 toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey
1228
1229 -- Other classes, needed for type defaulting
1230 monadPlusClassName, randomClassName, randomGenClassName,
1231 isStringClassName :: Name
1232 monadPlusClassName = clsQual mONAD (fsLit "MonadPlus") monadPlusClassKey
1233 randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey
1234 randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey
1235 isStringClassName = clsQual dATA_STRING (fsLit "IsString") isStringClassKey
1236
1237 -- Type-level naturals
1238 knownNatClassName :: Name
1239 knownNatClassName = clsQual gHC_TYPELITS (fsLit "KnownNat") knownNatClassNameKey
1240 knownSymbolClassName :: Name
1241 knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey
1242
1243 -- Source Locations
1244 callStackDataConName, callStackTyConName, srcLocDataConName :: Name
1245 callStackDataConName
1246 = dcQual gHC_STACK_TYPES (fsLit "CallStack") callStackDataConKey
1247 callStackTyConName
1248 = tcQual gHC_STACK_TYPES (fsLit "CallStack") callStackTyConKey
1249 srcLocDataConName
1250 = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey
1251
1252 -- plugins
1253 pLUGINS :: Module
1254 pLUGINS = mkThisGhcModule (fsLit "Plugins")
1255 pluginTyConName :: Name
1256 pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
1257
1258 -- Static pointers
1259 staticPtrInfoTyConName :: Name
1260 staticPtrInfoTyConName =
1261 tcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoTyConKey
1262
1263 staticPtrInfoDataConName :: Name
1264 staticPtrInfoDataConName =
1265 dcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoDataConKey
1266
1267 staticPtrTyConName :: Name
1268 staticPtrTyConName =
1269 tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
1270
1271 staticPtrDataConName :: Name
1272 staticPtrDataConName =
1273 dcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrDataConKey
1274
1275 fingerprintDataConName :: Name
1276 fingerprintDataConName =
1277 dcQual gHC_FINGERPRINT_TYPE (fsLit "Fingerprint") fingerprintDataConKey
1278
1279 {-
1280 ************************************************************************
1281 * *
1282 \subsection{Local helpers}
1283 * *
1284 ************************************************************************
1285
1286 All these are original names; hence mkOrig
1287 -}
1288
1289 varQual, tcQual, clsQual, dcQual :: Module -> FastString -> Unique -> Name
1290 varQual = mk_known_key_name varName
1291 tcQual = mk_known_key_name tcName
1292 clsQual = mk_known_key_name clsName
1293 dcQual = mk_known_key_name dataName
1294
1295 mk_known_key_name :: NameSpace -> Module -> FastString -> Unique -> Name
1296 mk_known_key_name space modu str unique
1297 = mkExternalName unique modu (mkOccNameFS space str) noSrcSpan
1298
1299
1300 {-
1301 ************************************************************************
1302 * *
1303 \subsubsection[Uniques-prelude-Classes]{@Uniques@ for wired-in @Classes@}
1304 * *
1305 ************************************************************************
1306 --MetaHaskell extension hand allocate keys here
1307 -}
1308
1309 boundedClassKey, enumClassKey, eqClassKey, floatingClassKey,
1310 fractionalClassKey, integralClassKey, monadClassKey, dataClassKey,
1311 functorClassKey, numClassKey, ordClassKey, readClassKey, realClassKey,
1312 realFloatClassKey, realFracClassKey, showClassKey, ixClassKey :: Unique
1313 boundedClassKey = mkPreludeClassUnique 1
1314 enumClassKey = mkPreludeClassUnique 2
1315 eqClassKey = mkPreludeClassUnique 3
1316 floatingClassKey = mkPreludeClassUnique 5
1317 fractionalClassKey = mkPreludeClassUnique 6
1318 integralClassKey = mkPreludeClassUnique 7
1319 monadClassKey = mkPreludeClassUnique 8
1320 dataClassKey = mkPreludeClassUnique 9
1321 functorClassKey = mkPreludeClassUnique 10
1322 numClassKey = mkPreludeClassUnique 11
1323 ordClassKey = mkPreludeClassUnique 12
1324 readClassKey = mkPreludeClassUnique 13
1325 realClassKey = mkPreludeClassUnique 14
1326 realFloatClassKey = mkPreludeClassUnique 15
1327 realFracClassKey = mkPreludeClassUnique 16
1328 showClassKey = mkPreludeClassUnique 17
1329 ixClassKey = mkPreludeClassUnique 18
1330
1331 typeableClassKey, typeable1ClassKey, typeable2ClassKey, typeable3ClassKey,
1332 typeable4ClassKey, typeable5ClassKey, typeable6ClassKey, typeable7ClassKey
1333 :: Unique
1334 typeableClassKey = mkPreludeClassUnique 20
1335 typeable1ClassKey = mkPreludeClassUnique 21
1336 typeable2ClassKey = mkPreludeClassUnique 22
1337 typeable3ClassKey = mkPreludeClassUnique 23
1338 typeable4ClassKey = mkPreludeClassUnique 24
1339 typeable5ClassKey = mkPreludeClassUnique 25
1340 typeable6ClassKey = mkPreludeClassUnique 26
1341 typeable7ClassKey = mkPreludeClassUnique 27
1342
1343 monadFixClassKey :: Unique
1344 monadFixClassKey = mkPreludeClassUnique 28
1345
1346 monadPlusClassKey, randomClassKey, randomGenClassKey :: Unique
1347 monadPlusClassKey = mkPreludeClassUnique 30
1348 randomClassKey = mkPreludeClassUnique 31
1349 randomGenClassKey = mkPreludeClassUnique 32
1350
1351 isStringClassKey :: Unique
1352 isStringClassKey = mkPreludeClassUnique 33
1353
1354 applicativeClassKey, foldableClassKey, traversableClassKey :: Unique
1355 applicativeClassKey = mkPreludeClassUnique 34
1356 foldableClassKey = mkPreludeClassUnique 35
1357 traversableClassKey = mkPreludeClassUnique 36
1358
1359 genClassKey, gen1ClassKey, datatypeClassKey, constructorClassKey,
1360 selectorClassKey :: Unique
1361 genClassKey = mkPreludeClassUnique 37
1362 gen1ClassKey = mkPreludeClassUnique 38
1363
1364 datatypeClassKey = mkPreludeClassUnique 39
1365 constructorClassKey = mkPreludeClassUnique 40
1366 selectorClassKey = mkPreludeClassUnique 41
1367
1368 -- KnownNat: see Note [KnowNat & KnownSymbol and EvLit] in TcEvidence
1369 knownNatClassNameKey :: Unique
1370 knownNatClassNameKey = mkPreludeClassUnique 42
1371
1372 -- KnownSymbol: see Note [KnownNat & KnownSymbol and EvLit] in TcEvidence
1373 knownSymbolClassNameKey :: Unique
1374 knownSymbolClassNameKey = mkPreludeClassUnique 43
1375
1376 ghciIoClassKey :: Unique
1377 ghciIoClassKey = mkPreludeClassUnique 44
1378
1379 ---------------- Template Haskell -------------------
1380 -- THNames.hs: USES ClassUniques 200-299
1381 -----------------------------------------------------
1382
1383 {-
1384 ************************************************************************
1385 * *
1386 \subsubsection[Uniques-prelude-TyCons]{@Uniques@ for wired-in @TyCons@}
1387 * *
1388 ************************************************************************
1389 -}
1390
1391 addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey,
1392 byteArrayPrimTyConKey, charPrimTyConKey, charTyConKey, doublePrimTyConKey,
1393 doubleTyConKey, floatPrimTyConKey, floatTyConKey, funTyConKey,
1394 intPrimTyConKey, intTyConKey, int8TyConKey, int16TyConKey,
1395 int32PrimTyConKey, int32TyConKey, int64PrimTyConKey, int64TyConKey,
1396 integerTyConKey, listTyConKey, foreignObjPrimTyConKey, maybeTyConKey,
1397 weakPrimTyConKey, mutableArrayPrimTyConKey, mutableArrayArrayPrimTyConKey,
1398 mutableByteArrayPrimTyConKey, orderingTyConKey, mVarPrimTyConKey,
1399 ratioTyConKey, rationalTyConKey, realWorldTyConKey, stablePtrPrimTyConKey,
1400 stablePtrTyConKey, anyTyConKey, eqTyConKey, smallArrayPrimTyConKey,
1401 smallMutableArrayPrimTyConKey :: Unique
1402 addrPrimTyConKey = mkPreludeTyConUnique 1
1403 arrayPrimTyConKey = mkPreludeTyConUnique 3
1404 boolTyConKey = mkPreludeTyConUnique 4
1405 byteArrayPrimTyConKey = mkPreludeTyConUnique 5
1406 charPrimTyConKey = mkPreludeTyConUnique 7
1407 charTyConKey = mkPreludeTyConUnique 8
1408 doublePrimTyConKey = mkPreludeTyConUnique 9
1409 doubleTyConKey = mkPreludeTyConUnique 10
1410 floatPrimTyConKey = mkPreludeTyConUnique 11
1411 floatTyConKey = mkPreludeTyConUnique 12
1412 funTyConKey = mkPreludeTyConUnique 13
1413 intPrimTyConKey = mkPreludeTyConUnique 14
1414 intTyConKey = mkPreludeTyConUnique 15
1415 int8TyConKey = mkPreludeTyConUnique 16
1416 int16TyConKey = mkPreludeTyConUnique 17
1417 int32PrimTyConKey = mkPreludeTyConUnique 18
1418 int32TyConKey = mkPreludeTyConUnique 19
1419 int64PrimTyConKey = mkPreludeTyConUnique 20
1420 int64TyConKey = mkPreludeTyConUnique 21
1421 integerTyConKey = mkPreludeTyConUnique 22
1422
1423 listTyConKey = mkPreludeTyConUnique 24
1424 foreignObjPrimTyConKey = mkPreludeTyConUnique 25
1425 maybeTyConKey = mkPreludeTyConUnique 26
1426 weakPrimTyConKey = mkPreludeTyConUnique 27
1427 mutableArrayPrimTyConKey = mkPreludeTyConUnique 28
1428 mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 29
1429 orderingTyConKey = mkPreludeTyConUnique 30
1430 mVarPrimTyConKey = mkPreludeTyConUnique 31
1431 ratioTyConKey = mkPreludeTyConUnique 32
1432 rationalTyConKey = mkPreludeTyConUnique 33
1433 realWorldTyConKey = mkPreludeTyConUnique 34
1434 stablePtrPrimTyConKey = mkPreludeTyConUnique 35
1435 stablePtrTyConKey = mkPreludeTyConUnique 36
1436 anyTyConKey = mkPreludeTyConUnique 37
1437 eqTyConKey = mkPreludeTyConUnique 38
1438 arrayArrayPrimTyConKey = mkPreludeTyConUnique 39
1439 mutableArrayArrayPrimTyConKey = mkPreludeTyConUnique 40
1440
1441 statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey,
1442 mutVarPrimTyConKey, ioTyConKey,
1443 wordPrimTyConKey, wordTyConKey, word8TyConKey, word16TyConKey,
1444 word32PrimTyConKey, word32TyConKey, word64PrimTyConKey, word64TyConKey,
1445 liftedConKey, unliftedConKey, anyBoxConKey, kindConKey, boxityConKey,
1446 typeConKey, threadIdPrimTyConKey, bcoPrimTyConKey, ptrTyConKey,
1447 funPtrTyConKey, tVarPrimTyConKey, eqPrimTyConKey,
1448 eqReprPrimTyConKey, voidPrimTyConKey :: Unique
1449 statePrimTyConKey = mkPreludeTyConUnique 50
1450 stableNamePrimTyConKey = mkPreludeTyConUnique 51
1451 stableNameTyConKey = mkPreludeTyConUnique 52
1452 eqPrimTyConKey = mkPreludeTyConUnique 53
1453 eqReprPrimTyConKey = mkPreludeTyConUnique 54
1454 mutVarPrimTyConKey = mkPreludeTyConUnique 55
1455 ioTyConKey = mkPreludeTyConUnique 56
1456 voidPrimTyConKey = mkPreludeTyConUnique 57
1457 wordPrimTyConKey = mkPreludeTyConUnique 58
1458 wordTyConKey = mkPreludeTyConUnique 59
1459 word8TyConKey = mkPreludeTyConUnique 60
1460 word16TyConKey = mkPreludeTyConUnique 61
1461 word32PrimTyConKey = mkPreludeTyConUnique 62
1462 word32TyConKey = mkPreludeTyConUnique 63
1463 word64PrimTyConKey = mkPreludeTyConUnique 64
1464 word64TyConKey = mkPreludeTyConUnique 65
1465 liftedConKey = mkPreludeTyConUnique 66
1466 unliftedConKey = mkPreludeTyConUnique 67
1467 anyBoxConKey = mkPreludeTyConUnique 68
1468 kindConKey = mkPreludeTyConUnique 69
1469 boxityConKey = mkPreludeTyConUnique 70
1470 typeConKey = mkPreludeTyConUnique 71
1471 threadIdPrimTyConKey = mkPreludeTyConUnique 72
1472 bcoPrimTyConKey = mkPreludeTyConUnique 73
1473 ptrTyConKey = mkPreludeTyConUnique 74
1474 funPtrTyConKey = mkPreludeTyConUnique 75
1475 tVarPrimTyConKey = mkPreludeTyConUnique 76
1476
1477 -- Parallel array type constructor
1478 parrTyConKey :: Unique
1479 parrTyConKey = mkPreludeTyConUnique 82
1480
1481 -- dotnet interop
1482 objectTyConKey :: Unique
1483 objectTyConKey = mkPreludeTyConUnique 83
1484
1485 eitherTyConKey :: Unique
1486 eitherTyConKey = mkPreludeTyConUnique 84
1487
1488 -- Super Kinds constructors
1489 superKindTyConKey :: Unique
1490 superKindTyConKey = mkPreludeTyConUnique 85
1491
1492 -- Kind constructors
1493 liftedTypeKindTyConKey, anyKindTyConKey, openTypeKindTyConKey,
1494 unliftedTypeKindTyConKey, constraintKindTyConKey :: Unique
1495 anyKindTyConKey = mkPreludeTyConUnique 86
1496 liftedTypeKindTyConKey = mkPreludeTyConUnique 87
1497 openTypeKindTyConKey = mkPreludeTyConUnique 88
1498 unliftedTypeKindTyConKey = mkPreludeTyConUnique 89
1499 constraintKindTyConKey = mkPreludeTyConUnique 92
1500
1501 -- Coercion constructors
1502 symCoercionTyConKey, transCoercionTyConKey, leftCoercionTyConKey,
1503 rightCoercionTyConKey, instCoercionTyConKey, unsafeCoercionTyConKey,
1504 csel1CoercionTyConKey, csel2CoercionTyConKey, cselRCoercionTyConKey
1505 :: Unique
1506 symCoercionTyConKey = mkPreludeTyConUnique 93
1507 transCoercionTyConKey = mkPreludeTyConUnique 94
1508 leftCoercionTyConKey = mkPreludeTyConUnique 95
1509 rightCoercionTyConKey = mkPreludeTyConUnique 96
1510 instCoercionTyConKey = mkPreludeTyConUnique 97
1511 unsafeCoercionTyConKey = mkPreludeTyConUnique 98
1512 csel1CoercionTyConKey = mkPreludeTyConUnique 99
1513 csel2CoercionTyConKey = mkPreludeTyConUnique 100
1514 cselRCoercionTyConKey = mkPreludeTyConUnique 101
1515
1516 pluginTyConKey :: Unique
1517 pluginTyConKey = mkPreludeTyConUnique 102
1518
1519 unknownTyConKey, unknown1TyConKey, unknown2TyConKey, unknown3TyConKey,
1520 opaqueTyConKey :: Unique
1521 unknownTyConKey = mkPreludeTyConUnique 129
1522 unknown1TyConKey = mkPreludeTyConUnique 130
1523 unknown2TyConKey = mkPreludeTyConUnique 131
1524 unknown3TyConKey = mkPreludeTyConUnique 132
1525 opaqueTyConKey = mkPreludeTyConUnique 133
1526
1527 -- Generics (Unique keys)
1528 v1TyConKey, u1TyConKey, par1TyConKey, rec1TyConKey,
1529 k1TyConKey, m1TyConKey, sumTyConKey, prodTyConKey,
1530 compTyConKey, rTyConKey, pTyConKey, dTyConKey,
1531 cTyConKey, sTyConKey, rec0TyConKey, par0TyConKey,
1532 d1TyConKey, c1TyConKey, s1TyConKey, noSelTyConKey,
1533 repTyConKey, rep1TyConKey, uRecTyConKey,
1534 uAddrTyConKey, uCharTyConKey, uDoubleTyConKey,
1535 uFloatTyConKey, uIntTyConKey, uWordTyConKey :: Unique
1536
1537 v1TyConKey = mkPreludeTyConUnique 135
1538 u1TyConKey = mkPreludeTyConUnique 136
1539 par1TyConKey = mkPreludeTyConUnique 137
1540 rec1TyConKey = mkPreludeTyConUnique 138
1541 k1TyConKey = mkPreludeTyConUnique 139
1542 m1TyConKey = mkPreludeTyConUnique 140
1543
1544 sumTyConKey = mkPreludeTyConUnique 141
1545 prodTyConKey = mkPreludeTyConUnique 142
1546 compTyConKey = mkPreludeTyConUnique 143
1547
1548 rTyConKey = mkPreludeTyConUnique 144
1549 pTyConKey = mkPreludeTyConUnique 145
1550 dTyConKey = mkPreludeTyConUnique 146
1551 cTyConKey = mkPreludeTyConUnique 147
1552 sTyConKey = mkPreludeTyConUnique 148
1553
1554 rec0TyConKey = mkPreludeTyConUnique 149
1555 par0TyConKey = mkPreludeTyConUnique 150
1556 d1TyConKey = mkPreludeTyConUnique 151
1557 c1TyConKey = mkPreludeTyConUnique 152
1558 s1TyConKey = mkPreludeTyConUnique 153
1559 noSelTyConKey = mkPreludeTyConUnique 154
1560
1561 repTyConKey = mkPreludeTyConUnique 155
1562 rep1TyConKey = mkPreludeTyConUnique 156
1563
1564 uRecTyConKey = mkPreludeTyConUnique 157
1565 uAddrTyConKey = mkPreludeTyConUnique 158
1566 uCharTyConKey = mkPreludeTyConUnique 159
1567 uDoubleTyConKey = mkPreludeTyConUnique 160
1568 uFloatTyConKey = mkPreludeTyConUnique 161
1569 uIntTyConKey = mkPreludeTyConUnique 162
1570 uWordTyConKey = mkPreludeTyConUnique 163
1571
1572 -- Type-level naturals
1573 typeNatKindConNameKey, typeSymbolKindConNameKey,
1574 typeNatAddTyFamNameKey, typeNatMulTyFamNameKey, typeNatExpTyFamNameKey,
1575 typeNatLeqTyFamNameKey, typeNatSubTyFamNameKey
1576 , typeSymbolCmpTyFamNameKey, typeNatCmpTyFamNameKey
1577 :: Unique
1578 typeNatKindConNameKey = mkPreludeTyConUnique 164
1579 typeSymbolKindConNameKey = mkPreludeTyConUnique 165
1580 typeNatAddTyFamNameKey = mkPreludeTyConUnique 166
1581 typeNatMulTyFamNameKey = mkPreludeTyConUnique 167
1582 typeNatExpTyFamNameKey = mkPreludeTyConUnique 168
1583 typeNatLeqTyFamNameKey = mkPreludeTyConUnique 169
1584 typeNatSubTyFamNameKey = mkPreludeTyConUnique 170
1585 typeSymbolCmpTyFamNameKey = mkPreludeTyConUnique 171
1586 typeNatCmpTyFamNameKey = mkPreludeTyConUnique 172
1587
1588 ntTyConKey:: Unique
1589 ntTyConKey = mkPreludeTyConUnique 174
1590 coercibleTyConKey :: Unique
1591 coercibleTyConKey = mkPreludeTyConUnique 175
1592
1593 proxyPrimTyConKey :: Unique
1594 proxyPrimTyConKey = mkPreludeTyConUnique 176
1595
1596 specTyConKey :: Unique
1597 specTyConKey = mkPreludeTyConUnique 177
1598
1599 smallArrayPrimTyConKey = mkPreludeTyConUnique 178
1600 smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 179
1601
1602 staticPtrTyConKey :: Unique
1603 staticPtrTyConKey = mkPreludeTyConUnique 180
1604
1605 staticPtrInfoTyConKey :: Unique
1606 staticPtrInfoTyConKey = mkPreludeTyConUnique 181
1607
1608 callStackTyConKey :: Unique
1609 callStackTyConKey = mkPreludeTyConUnique 182
1610
1611 -- Typeables
1612 typeRepTyConKey :: Unique
1613 typeRepTyConKey = mkPreludeTyConUnique 183
1614
1615 -- Implicit Parameters
1616 ipTyConKey :: Unique
1617 ipTyConKey = mkPreludeTyConUnique 184
1618
1619 ipCoNameKey :: Unique
1620 ipCoNameKey = mkPreludeTyConUnique 185
1621
1622
1623 ---------------- Template Haskell -------------------
1624 -- THNames.hs: USES TyConUniques 200-299
1625 -----------------------------------------------------
1626
1627 ----------------------- SIMD ------------------------
1628 -- USES TyConUniques 300-399
1629 -----------------------------------------------------
1630
1631 #include "primop-vector-uniques.hs-incl"
1632
1633 {-
1634 ************************************************************************
1635 * *
1636 \subsubsection[Uniques-prelude-DataCons]{@Uniques@ for wired-in @DataCons@}
1637 * *
1638 ************************************************************************
1639 -}
1640
1641 charDataConKey, consDataConKey, doubleDataConKey, falseDataConKey,
1642 floatDataConKey, intDataConKey, integerSDataConKey, nilDataConKey,
1643 ratioDataConKey, stableNameDataConKey, trueDataConKey, wordDataConKey,
1644 word8DataConKey, ioDataConKey, integerDataConKey, eqBoxDataConKey,
1645 coercibleDataConKey, nothingDataConKey, justDataConKey :: Unique
1646 charDataConKey = mkPreludeDataConUnique 1
1647 consDataConKey = mkPreludeDataConUnique 2
1648 doubleDataConKey = mkPreludeDataConUnique 3
1649 falseDataConKey = mkPreludeDataConUnique 4
1650 floatDataConKey = mkPreludeDataConUnique 5
1651 intDataConKey = mkPreludeDataConUnique 6
1652 integerSDataConKey = mkPreludeDataConUnique 7
1653 nothingDataConKey = mkPreludeDataConUnique 8
1654 justDataConKey = mkPreludeDataConUnique 9
1655 nilDataConKey = mkPreludeDataConUnique 11
1656 ratioDataConKey = mkPreludeDataConUnique 12
1657 word8DataConKey = mkPreludeDataConUnique 13
1658 stableNameDataConKey = mkPreludeDataConUnique 14
1659 trueDataConKey = mkPreludeDataConUnique 15
1660 wordDataConKey = mkPreludeDataConUnique 16
1661 ioDataConKey = mkPreludeDataConUnique 17
1662 integerDataConKey = mkPreludeDataConUnique 18
1663 eqBoxDataConKey = mkPreludeDataConUnique 19
1664
1665 -- Generic data constructors
1666 crossDataConKey, inlDataConKey, inrDataConKey, genUnitDataConKey :: Unique
1667 crossDataConKey = mkPreludeDataConUnique 20
1668 inlDataConKey = mkPreludeDataConUnique 21
1669 inrDataConKey = mkPreludeDataConUnique 22
1670 genUnitDataConKey = mkPreludeDataConUnique 23
1671
1672 -- Data constructor for parallel arrays
1673 parrDataConKey :: Unique
1674 parrDataConKey = mkPreludeDataConUnique 24
1675
1676 leftDataConKey, rightDataConKey :: Unique
1677 leftDataConKey = mkPreludeDataConUnique 25
1678 rightDataConKey = mkPreludeDataConUnique 26
1679
1680 ltDataConKey, eqDataConKey, gtDataConKey :: Unique
1681 ltDataConKey = mkPreludeDataConUnique 27
1682 eqDataConKey = mkPreludeDataConUnique 28
1683 gtDataConKey = mkPreludeDataConUnique 29
1684
1685 coercibleDataConKey = mkPreludeDataConUnique 32
1686
1687 staticPtrDataConKey :: Unique
1688 staticPtrDataConKey = mkPreludeDataConUnique 33
1689
1690 staticPtrInfoDataConKey :: Unique
1691 staticPtrInfoDataConKey = mkPreludeDataConUnique 34
1692
1693 fingerprintDataConKey :: Unique
1694 fingerprintDataConKey = mkPreludeDataConUnique 35
1695
1696 callStackDataConKey, srcLocDataConKey :: Unique
1697 callStackDataConKey = mkPreludeDataConUnique 36
1698 srcLocDataConKey = mkPreludeDataConUnique 37
1699
1700 ipDataConKey :: Unique
1701 ipDataConKey = mkPreludeDataConUnique 38
1702
1703 trTyConDataConKey, trModuleDataConKey, trNameSDataConKey :: Unique
1704 trTyConDataConKey = mkPreludeDataConUnique 40
1705 trModuleDataConKey = mkPreludeDataConUnique 41
1706 trNameSDataConKey = mkPreludeDataConUnique 42
1707
1708 ---------------- Template Haskell -------------------
1709 -- THNames.hs: USES DataUniques 100-150
1710 -----------------------------------------------------
1711
1712
1713 {-
1714 ************************************************************************
1715 * *
1716 \subsubsection[Uniques-prelude-Ids]{@Uniques@ for wired-in @Ids@ (except @DataCons@)}
1717 * *
1718 ************************************************************************
1719 -}
1720
1721 wildCardKey, absentErrorIdKey, augmentIdKey, appendIdKey,
1722 buildIdKey, errorIdKey, foldrIdKey, recSelErrorIdKey,
1723 seqIdKey, irrefutPatErrorIdKey, eqStringIdKey,
1724 noMethodBindingErrorIdKey, nonExhaustiveGuardsErrorIdKey,
1725 runtimeErrorIdKey, patErrorIdKey, voidPrimIdKey,
1726 realWorldPrimIdKey, recConErrorIdKey,
1727 unpackCStringUtf8IdKey, unpackCStringAppendIdKey,
1728 unpackCStringFoldrIdKey, unpackCStringIdKey,
1729 typeErrorIdKey :: Unique
1730
1731 wildCardKey = mkPreludeMiscIdUnique 0 -- See Note [WildCard binders]
1732 absentErrorIdKey = mkPreludeMiscIdUnique 1
1733 augmentIdKey = mkPreludeMiscIdUnique 2
1734 appendIdKey = mkPreludeMiscIdUnique 3
1735 buildIdKey = mkPreludeMiscIdUnique 4
1736 errorIdKey = mkPreludeMiscIdUnique 5
1737 foldrIdKey = mkPreludeMiscIdUnique 6
1738 recSelErrorIdKey = mkPreludeMiscIdUnique 7
1739 seqIdKey = mkPreludeMiscIdUnique 8
1740 irrefutPatErrorIdKey = mkPreludeMiscIdUnique 9
1741 eqStringIdKey = mkPreludeMiscIdUnique 10
1742 noMethodBindingErrorIdKey = mkPreludeMiscIdUnique 11
1743 nonExhaustiveGuardsErrorIdKey = mkPreludeMiscIdUnique 12
1744 runtimeErrorIdKey = mkPreludeMiscIdUnique 13
1745 patErrorIdKey = mkPreludeMiscIdUnique 14
1746 realWorldPrimIdKey = mkPreludeMiscIdUnique 15
1747 recConErrorIdKey = mkPreludeMiscIdUnique 16
1748 unpackCStringUtf8IdKey = mkPreludeMiscIdUnique 17
1749 unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18
1750 unpackCStringFoldrIdKey = mkPreludeMiscIdUnique 19
1751 unpackCStringIdKey = mkPreludeMiscIdUnique 20
1752 voidPrimIdKey = mkPreludeMiscIdUnique 21
1753 typeErrorIdKey = mkPreludeMiscIdUnique 22
1754
1755 unsafeCoerceIdKey, concatIdKey, filterIdKey, zipIdKey, bindIOIdKey,
1756 returnIOIdKey, newStablePtrIdKey,
1757 printIdKey, failIOIdKey, nullAddrIdKey, voidArgIdKey,
1758 fstIdKey, sndIdKey, otherwiseIdKey, assertIdKey :: Unique
1759 unsafeCoerceIdKey = mkPreludeMiscIdUnique 30
1760 concatIdKey = mkPreludeMiscIdUnique 31
1761 filterIdKey = mkPreludeMiscIdUnique 32
1762 zipIdKey = mkPreludeMiscIdUnique 33
1763 bindIOIdKey = mkPreludeMiscIdUnique 34
1764 returnIOIdKey = mkPreludeMiscIdUnique 35
1765 newStablePtrIdKey = mkPreludeMiscIdUnique 36
1766 printIdKey = mkPreludeMiscIdUnique 37
1767 failIOIdKey = mkPreludeMiscIdUnique 38
1768 nullAddrIdKey = mkPreludeMiscIdUnique 39
1769 voidArgIdKey = mkPreludeMiscIdUnique 40
1770 fstIdKey = mkPreludeMiscIdUnique 41
1771 sndIdKey = mkPreludeMiscIdUnique 42
1772 otherwiseIdKey = mkPreludeMiscIdUnique 43
1773 assertIdKey = mkPreludeMiscIdUnique 44
1774
1775 mkIntegerIdKey, smallIntegerIdKey, wordToIntegerIdKey,
1776 integerToWordIdKey, integerToIntIdKey,
1777 integerToWord64IdKey, integerToInt64IdKey,
1778 word64ToIntegerIdKey, int64ToIntegerIdKey,
1779 plusIntegerIdKey, timesIntegerIdKey, minusIntegerIdKey,
1780 negateIntegerIdKey,
1781 eqIntegerPrimIdKey, neqIntegerPrimIdKey, absIntegerIdKey, signumIntegerIdKey,
1782 leIntegerPrimIdKey, gtIntegerPrimIdKey, ltIntegerPrimIdKey, geIntegerPrimIdKey,
1783 compareIntegerIdKey, quotRemIntegerIdKey, divModIntegerIdKey,
1784 quotIntegerIdKey, remIntegerIdKey, divIntegerIdKey, modIntegerIdKey,
1785 floatFromIntegerIdKey, doubleFromIntegerIdKey,
1786 encodeFloatIntegerIdKey, encodeDoubleIntegerIdKey,
1787 decodeDoubleIntegerIdKey,
1788 gcdIntegerIdKey, lcmIntegerIdKey,
1789 andIntegerIdKey, orIntegerIdKey, xorIntegerIdKey, complementIntegerIdKey,
1790 shiftLIntegerIdKey, shiftRIntegerIdKey :: Unique
1791 mkIntegerIdKey = mkPreludeMiscIdUnique 60
1792 smallIntegerIdKey = mkPreludeMiscIdUnique 61
1793 integerToWordIdKey = mkPreludeMiscIdUnique 62
1794 integerToIntIdKey = mkPreludeMiscIdUnique 63
1795 integerToWord64IdKey = mkPreludeMiscIdUnique 64
1796 integerToInt64IdKey = mkPreludeMiscIdUnique 65
1797 plusIntegerIdKey = mkPreludeMiscIdUnique 66
1798 timesIntegerIdKey = mkPreludeMiscIdUnique 67
1799 minusIntegerIdKey = mkPreludeMiscIdUnique 68
1800 negateIntegerIdKey = mkPreludeMiscIdUnique 69
1801 eqIntegerPrimIdKey = mkPreludeMiscIdUnique 70
1802 neqIntegerPrimIdKey = mkPreludeMiscIdUnique 71
1803 absIntegerIdKey = mkPreludeMiscIdUnique 72
1804 signumIntegerIdKey = mkPreludeMiscIdUnique 73
1805 leIntegerPrimIdKey = mkPreludeMiscIdUnique 74
1806 gtIntegerPrimIdKey = mkPreludeMiscIdUnique 75
1807 ltIntegerPrimIdKey = mkPreludeMiscIdUnique 76
1808 geIntegerPrimIdKey = mkPreludeMiscIdUnique 77
1809 compareIntegerIdKey = mkPreludeMiscIdUnique 78
1810 quotIntegerIdKey = mkPreludeMiscIdUnique 79
1811 remIntegerIdKey = mkPreludeMiscIdUnique 80
1812 divIntegerIdKey = mkPreludeMiscIdUnique 81
1813 modIntegerIdKey = mkPreludeMiscIdUnique 82
1814 divModIntegerIdKey = mkPreludeMiscIdUnique 83
1815 quotRemIntegerIdKey = mkPreludeMiscIdUnique 84
1816 floatFromIntegerIdKey = mkPreludeMiscIdUnique 85
1817 doubleFromIntegerIdKey = mkPreludeMiscIdUnique 86
1818 encodeFloatIntegerIdKey = mkPreludeMiscIdUnique 87
1819 encodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 88
1820 gcdIntegerIdKey = mkPreludeMiscIdUnique 89
1821 lcmIntegerIdKey = mkPreludeMiscIdUnique 90
1822 andIntegerIdKey = mkPreludeMiscIdUnique 91
1823 orIntegerIdKey = mkPreludeMiscIdUnique 92
1824 xorIntegerIdKey = mkPreludeMiscIdUnique 93
1825 complementIntegerIdKey = mkPreludeMiscIdUnique 94
1826 shiftLIntegerIdKey = mkPreludeMiscIdUnique 95
1827 shiftRIntegerIdKey = mkPreludeMiscIdUnique 96
1828 wordToIntegerIdKey = mkPreludeMiscIdUnique 97
1829 word64ToIntegerIdKey = mkPreludeMiscIdUnique 98
1830 int64ToIntegerIdKey = mkPreludeMiscIdUnique 99
1831 decodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 100
1832
1833 rootMainKey, runMainKey :: Unique
1834 rootMainKey = mkPreludeMiscIdUnique 101
1835 runMainKey = mkPreludeMiscIdUnique 102
1836
1837 thenIOIdKey, lazyIdKey, assertErrorIdKey, oneShotKey :: Unique
1838 thenIOIdKey = mkPreludeMiscIdUnique 103
1839 lazyIdKey = mkPreludeMiscIdUnique 104
1840 assertErrorIdKey = mkPreludeMiscIdUnique 105
1841 oneShotKey = mkPreludeMiscIdUnique 106
1842
1843 breakpointIdKey, breakpointCondIdKey, breakpointAutoIdKey,
1844 breakpointJumpIdKey, breakpointCondJumpIdKey,
1845 breakpointAutoJumpIdKey :: Unique
1846 breakpointIdKey = mkPreludeMiscIdUnique 110
1847 breakpointCondIdKey = mkPreludeMiscIdUnique 111
1848 breakpointAutoIdKey = mkPreludeMiscIdUnique 112
1849 breakpointJumpIdKey = mkPreludeMiscIdUnique 113
1850 breakpointCondJumpIdKey = mkPreludeMiscIdUnique 114
1851 breakpointAutoJumpIdKey = mkPreludeMiscIdUnique 115
1852
1853 inlineIdKey :: Unique
1854 inlineIdKey = mkPreludeMiscIdUnique 120
1855
1856 mapIdKey, groupWithIdKey, dollarIdKey :: Unique
1857 mapIdKey = mkPreludeMiscIdUnique 121
1858 groupWithIdKey = mkPreludeMiscIdUnique 122
1859 dollarIdKey = mkPreludeMiscIdUnique 123
1860
1861 coercionTokenIdKey :: Unique
1862 coercionTokenIdKey = mkPreludeMiscIdUnique 124
1863
1864 rationalToFloatIdKey, rationalToDoubleIdKey :: Unique
1865 rationalToFloatIdKey = mkPreludeMiscIdUnique 130
1866 rationalToDoubleIdKey = mkPreludeMiscIdUnique 131
1867
1868 -- dotnet interop
1869 unmarshalObjectIdKey, marshalObjectIdKey, marshalStringIdKey,
1870 unmarshalStringIdKey, checkDotnetResNameIdKey :: Unique
1871 unmarshalObjectIdKey = mkPreludeMiscIdUnique 150
1872 marshalObjectIdKey = mkPreludeMiscIdUnique 151
1873 marshalStringIdKey = mkPreludeMiscIdUnique 152
1874 unmarshalStringIdKey = mkPreludeMiscIdUnique 153
1875 checkDotnetResNameIdKey = mkPreludeMiscIdUnique 154
1876
1877 undefinedKey :: Unique
1878 undefinedKey = mkPreludeMiscIdUnique 155
1879
1880 magicDictKey :: Unique
1881 magicDictKey = mkPreludeMiscIdUnique 156
1882
1883 coerceKey :: Unique
1884 coerceKey = mkPreludeMiscIdUnique 157
1885
1886 {-
1887 Certain class operations from Prelude classes. They get their own
1888 uniques so we can look them up easily when we want to conjure them up
1889 during type checking.
1890 -}
1891
1892 -- Just a place holder for unbound variables produced by the renamer:
1893 unboundKey :: Unique
1894 unboundKey = mkPreludeMiscIdUnique 158
1895
1896 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey,
1897 enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey,
1898 enumFromThenToClassOpKey, eqClassOpKey, geClassOpKey, negateClassOpKey,
1899 failMClassOpKey, bindMClassOpKey, thenMClassOpKey, returnMClassOpKey,
1900 fmapClassOpKey
1901 :: Unique
1902 fromIntegerClassOpKey = mkPreludeMiscIdUnique 160
1903 minusClassOpKey = mkPreludeMiscIdUnique 161
1904 fromRationalClassOpKey = mkPreludeMiscIdUnique 162
1905 enumFromClassOpKey = mkPreludeMiscIdUnique 163
1906 enumFromThenClassOpKey = mkPreludeMiscIdUnique 164
1907 enumFromToClassOpKey = mkPreludeMiscIdUnique 165
1908 enumFromThenToClassOpKey = mkPreludeMiscIdUnique 166
1909 eqClassOpKey = mkPreludeMiscIdUnique 167
1910 geClassOpKey = mkPreludeMiscIdUnique 168
1911 negateClassOpKey = mkPreludeMiscIdUnique 169
1912 failMClassOpKey = mkPreludeMiscIdUnique 170
1913 bindMClassOpKey = mkPreludeMiscIdUnique 171 -- (>>=)
1914 thenMClassOpKey = mkPreludeMiscIdUnique 172 -- (>>)
1915 fmapClassOpKey = mkPreludeMiscIdUnique 173
1916 returnMClassOpKey = mkPreludeMiscIdUnique 174
1917
1918 -- Recursive do notation
1919 mfixIdKey :: Unique
1920 mfixIdKey = mkPreludeMiscIdUnique 175
1921
1922 -- Arrow notation
1923 arrAIdKey, composeAIdKey, firstAIdKey, appAIdKey, choiceAIdKey,
1924 loopAIdKey :: Unique
1925 arrAIdKey = mkPreludeMiscIdUnique 180
1926 composeAIdKey = mkPreludeMiscIdUnique 181 -- >>>
1927 firstAIdKey = mkPreludeMiscIdUnique 182
1928 appAIdKey = mkPreludeMiscIdUnique 183
1929 choiceAIdKey = mkPreludeMiscIdUnique 184 -- |||
1930 loopAIdKey = mkPreludeMiscIdUnique 185
1931
1932 fromStringClassOpKey :: Unique
1933 fromStringClassOpKey = mkPreludeMiscIdUnique 186
1934
1935 -- Annotation type checking
1936 toAnnotationWrapperIdKey :: Unique
1937 toAnnotationWrapperIdKey = mkPreludeMiscIdUnique 187
1938
1939 -- Conversion functions
1940 fromIntegralIdKey, realToFracIdKey, toIntegerClassOpKey, toRationalClassOpKey :: Unique
1941 fromIntegralIdKey = mkPreludeMiscIdUnique 190
1942 realToFracIdKey = mkPreludeMiscIdUnique 191
1943 toIntegerClassOpKey = mkPreludeMiscIdUnique 192
1944 toRationalClassOpKey = mkPreludeMiscIdUnique 193
1945
1946 -- Monad comprehensions
1947 guardMIdKey, liftMIdKey, mzipIdKey :: Unique
1948 guardMIdKey = mkPreludeMiscIdUnique 194
1949 liftMIdKey = mkPreludeMiscIdUnique 195
1950 mzipIdKey = mkPreludeMiscIdUnique 196
1951
1952 -- GHCi
1953 ghciStepIoMClassOpKey :: Unique
1954 ghciStepIoMClassOpKey = mkPreludeMiscIdUnique 197
1955
1956 -- Overloaded lists
1957 isListClassKey, fromListClassOpKey, fromListNClassOpKey, toListClassOpKey :: Unique
1958 isListClassKey = mkPreludeMiscIdUnique 198
1959 fromListClassOpKey = mkPreludeMiscIdUnique 199
1960 fromListNClassOpKey = mkPreludeMiscIdUnique 500
1961 toListClassOpKey = mkPreludeMiscIdUnique 501
1962
1963 proxyHashKey :: Unique
1964 proxyHashKey = mkPreludeMiscIdUnique 502
1965
1966 ---------------- Template Haskell -------------------
1967 -- THNames.hs: USES IdUniques 200-499
1968 -----------------------------------------------------
1969
1970 -- Used to make `Typeable` dictionaries
1971 mkTyConKey
1972 , mkPolyTyConAppKey
1973 , mkAppTyKey
1974 , typeNatTypeRepKey
1975 , typeSymbolTypeRepKey
1976 , typeRepIdKey
1977 :: Unique
1978 mkTyConKey = mkPreludeMiscIdUnique 503
1979 mkPolyTyConAppKey = mkPreludeMiscIdUnique 504
1980 mkAppTyKey = mkPreludeMiscIdUnique 505
1981 typeNatTypeRepKey = mkPreludeMiscIdUnique 506
1982 typeSymbolTypeRepKey = mkPreludeMiscIdUnique 507
1983 typeRepIdKey = mkPreludeMiscIdUnique 508
1984
1985 -- Dynamic
1986 toDynIdKey :: Unique
1987 toDynIdKey = mkPreludeMiscIdUnique 509
1988
1989 bitIntegerIdKey :: Unique
1990 bitIntegerIdKey = mkPreludeMiscIdUnique 510
1991
1992 {-
1993 ************************************************************************
1994 * *
1995 \subsection[Class-std-groups]{Standard groups of Prelude classes}
1996 * *
1997 ************************************************************************
1998
1999 NOTE: @Eq@ and @Text@ do need to appear in @standardClasses@
2000 even though every numeric class has these two as a superclass,
2001 because the list of ambiguous dictionaries hasn't been simplified.
2002 -}
2003
2004 numericClassKeys :: [Unique]
2005 numericClassKeys =
2006 [ numClassKey
2007 , realClassKey
2008 , integralClassKey
2009 ]
2010 ++ fractionalClassKeys
2011
2012 fractionalClassKeys :: [Unique]
2013 fractionalClassKeys =
2014 [ fractionalClassKey
2015 , floatingClassKey
2016 , realFracClassKey
2017 , realFloatClassKey
2018 ]
2019
2020 -- The "standard classes" are used in defaulting (Haskell 98 report 4.3.4),
2021 -- and are: "classes defined in the Prelude or a standard library"
2022 standardClassKeys :: [Unique]
2023 standardClassKeys = derivableClassKeys ++ numericClassKeys
2024 ++ [randomClassKey, randomGenClassKey,
2025 functorClassKey,
2026 monadClassKey, monadPlusClassKey,
2027 isStringClassKey,
2028 applicativeClassKey, foldableClassKey,
2029 traversableClassKey, alternativeClassKey
2030 ]
2031
2032 {-
2033 @derivableClassKeys@ is also used in checking \tr{deriving} constructs
2034 (@TcDeriv@).
2035 -}
2036
2037 derivableClassKeys :: [Unique]
2038 derivableClassKeys
2039 = [ eqClassKey, ordClassKey, enumClassKey, ixClassKey,
2040 boundedClassKey, showClassKey, readClassKey ]