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