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