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