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