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