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