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