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