Allow CallStacks to be frozen
[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 -- | Make a 'Name' for the 'Typeable' representation of the given wired-in type
827 mkPrelTyConRepName :: Name -> Name
828 -- See Note [Grand plan for Typeable] in 'TcTypeable' in TcTypeable.
829 mkPrelTyConRepName tc_name -- Prelude tc_name is always External,
830 -- so nameModule will work
831 = mkExternalName rep_uniq rep_mod rep_occ (nameSrcSpan tc_name)
832 where
833 name_occ = nameOccName tc_name
834 name_mod = nameModule tc_name
835 name_uniq = nameUnique tc_name
836 rep_uniq | isTcOcc name_occ = tyConRepNameUnique name_uniq
837 | otherwise = dataConRepNameUnique name_uniq
838 (rep_mod, rep_occ) = tyConRepModOcc name_mod name_occ
839
840 -- | TODO
841 -- See Note [Grand plan for Typeable] in 'TcTypeable' in TcTypeable.
842 tyConRepModOcc :: Module -> OccName -> (Module, OccName)
843 tyConRepModOcc tc_module tc_occ
844 | tc_module == gHC_TYPES
845 = (tYPEABLE_INTERNAL, mkTyConRepUserOcc tc_occ)
846 | otherwise
847 = (tc_module, mkTyConRepSysOcc tc_occ)
848
849 wildCardName :: Name
850 wildCardName = mkSystemVarName wildCardKey (fsLit "wild")
851
852 runMainIOName :: Name
853 runMainIOName = varQual gHC_TOP_HANDLER (fsLit "runMainIO") runMainKey
854
855 orderingTyConName, ltDataConName, eqDataConName, gtDataConName :: Name
856 orderingTyConName = tcQual gHC_TYPES (fsLit "Ordering") orderingTyConKey
857 ltDataConName = dcQual gHC_TYPES (fsLit "LT") ltDataConKey
858 eqDataConName = dcQual gHC_TYPES (fsLit "EQ") eqDataConKey
859 gtDataConName = dcQual gHC_TYPES (fsLit "GT") gtDataConKey
860
861 specTyConName :: Name
862 specTyConName = tcQual gHC_TYPES (fsLit "SPEC") specTyConKey
863
864 eitherTyConName, leftDataConName, rightDataConName :: Name
865 eitherTyConName = tcQual dATA_EITHER (fsLit "Either") eitherTyConKey
866 leftDataConName = dcQual dATA_EITHER (fsLit "Left") leftDataConKey
867 rightDataConName = dcQual dATA_EITHER (fsLit "Right") rightDataConKey
868
869 -- Generics (types)
870 v1TyConName, u1TyConName, par1TyConName, rec1TyConName,
871 k1TyConName, m1TyConName, sumTyConName, prodTyConName,
872 compTyConName, rTyConName, dTyConName,
873 cTyConName, sTyConName, rec0TyConName,
874 d1TyConName, c1TyConName, s1TyConName, noSelTyConName,
875 repTyConName, rep1TyConName, uRecTyConName,
876 uAddrTyConName, uCharTyConName, uDoubleTyConName,
877 uFloatTyConName, uIntTyConName, uWordTyConName,
878 prefixIDataConName, infixIDataConName, leftAssociativeDataConName,
879 rightAssociativeDataConName, notAssociativeDataConName,
880 sourceUnpackDataConName, sourceNoUnpackDataConName,
881 noSourceUnpackednessDataConName, sourceLazyDataConName,
882 sourceStrictDataConName, noSourceStrictnessDataConName,
883 decidedLazyDataConName, decidedStrictDataConName, decidedUnpackDataConName,
884 metaDataDataConName, metaConsDataConName, metaSelDataConName :: Name
885
886 v1TyConName = tcQual gHC_GENERICS (fsLit "V1") v1TyConKey
887 u1TyConName = tcQual gHC_GENERICS (fsLit "U1") u1TyConKey
888 par1TyConName = tcQual gHC_GENERICS (fsLit "Par1") par1TyConKey
889 rec1TyConName = tcQual gHC_GENERICS (fsLit "Rec1") rec1TyConKey
890 k1TyConName = tcQual gHC_GENERICS (fsLit "K1") k1TyConKey
891 m1TyConName = tcQual gHC_GENERICS (fsLit "M1") m1TyConKey
892
893 sumTyConName = tcQual gHC_GENERICS (fsLit ":+:") sumTyConKey
894 prodTyConName = tcQual gHC_GENERICS (fsLit ":*:") prodTyConKey
895 compTyConName = tcQual gHC_GENERICS (fsLit ":.:") compTyConKey
896
897 rTyConName = tcQual gHC_GENERICS (fsLit "R") rTyConKey
898 dTyConName = tcQual gHC_GENERICS (fsLit "D") dTyConKey
899 cTyConName = tcQual gHC_GENERICS (fsLit "C") cTyConKey
900 sTyConName = tcQual gHC_GENERICS (fsLit "S") sTyConKey
901
902 rec0TyConName = tcQual gHC_GENERICS (fsLit "Rec0") rec0TyConKey
903 d1TyConName = tcQual gHC_GENERICS (fsLit "D1") d1TyConKey
904 c1TyConName = tcQual gHC_GENERICS (fsLit "C1") c1TyConKey
905 s1TyConName = tcQual gHC_GENERICS (fsLit "S1") s1TyConKey
906 noSelTyConName = tcQual gHC_GENERICS (fsLit "NoSelector") noSelTyConKey
907
908 repTyConName = tcQual gHC_GENERICS (fsLit "Rep") repTyConKey
909 rep1TyConName = tcQual gHC_GENERICS (fsLit "Rep1") rep1TyConKey
910
911 uRecTyConName = tcQual gHC_GENERICS (fsLit "URec") uRecTyConKey
912 uAddrTyConName = tcQual gHC_GENERICS (fsLit "UAddr") uAddrTyConKey
913 uCharTyConName = tcQual gHC_GENERICS (fsLit "UChar") uCharTyConKey
914 uDoubleTyConName = tcQual gHC_GENERICS (fsLit "UDouble") uDoubleTyConKey
915 uFloatTyConName = tcQual gHC_GENERICS (fsLit "UFloat") uFloatTyConKey
916 uIntTyConName = tcQual gHC_GENERICS (fsLit "UInt") uIntTyConKey
917 uWordTyConName = tcQual gHC_GENERICS (fsLit "UWord") uWordTyConKey
918
919 prefixIDataConName = dcQual gHC_GENERICS (fsLit "PrefixI") prefixIDataConKey
920 infixIDataConName = dcQual gHC_GENERICS (fsLit "InfixI") infixIDataConKey
921 leftAssociativeDataConName = dcQual gHC_GENERICS (fsLit "LeftAssociative") leftAssociativeDataConKey
922 rightAssociativeDataConName = dcQual gHC_GENERICS (fsLit "RightAssociative") rightAssociativeDataConKey
923 notAssociativeDataConName = dcQual gHC_GENERICS (fsLit "NotAssociative") notAssociativeDataConKey
924
925 sourceUnpackDataConName = dcQual gHC_GENERICS (fsLit "SourceUnpack") sourceUnpackDataConKey
926 sourceNoUnpackDataConName = dcQual gHC_GENERICS (fsLit "SourceNoUnpack") sourceNoUnpackDataConKey
927 noSourceUnpackednessDataConName = dcQual gHC_GENERICS (fsLit "NoSourceUnpackedness") noSourceUnpackednessDataConKey
928 sourceLazyDataConName = dcQual gHC_GENERICS (fsLit "SourceLazy") sourceLazyDataConKey
929 sourceStrictDataConName = dcQual gHC_GENERICS (fsLit "SourceStrict") sourceStrictDataConKey
930 noSourceStrictnessDataConName = dcQual gHC_GENERICS (fsLit "NoSourceStrictness") noSourceStrictnessDataConKey
931 decidedLazyDataConName = dcQual gHC_GENERICS (fsLit "DecidedLazy") decidedLazyDataConKey
932 decidedStrictDataConName = dcQual gHC_GENERICS (fsLit "DecidedStrict") decidedStrictDataConKey
933 decidedUnpackDataConName = dcQual gHC_GENERICS (fsLit "DecidedUnpack") decidedUnpackDataConKey
934
935 metaDataDataConName = dcQual gHC_GENERICS (fsLit "MetaData") metaDataDataConKey
936 metaConsDataConName = dcQual gHC_GENERICS (fsLit "MetaCons") metaConsDataConKey
937 metaSelDataConName = dcQual gHC_GENERICS (fsLit "MetaSel") metaSelDataConKey
938
939 -- Base strings Strings
940 unpackCStringName, unpackCStringFoldrName,
941 unpackCStringUtf8Name, eqStringName :: Name
942 unpackCStringName = varQual gHC_CSTRING (fsLit "unpackCString#") unpackCStringIdKey
943 unpackCStringFoldrName = varQual gHC_CSTRING (fsLit "unpackFoldrCString#") unpackCStringFoldrIdKey
944 unpackCStringUtf8Name = varQual gHC_CSTRING (fsLit "unpackCStringUtf8#") unpackCStringUtf8IdKey
945 eqStringName = varQual gHC_BASE (fsLit "eqString") eqStringIdKey
946
947 -- The 'inline' function
948 inlineIdName :: Name
949 inlineIdName = varQual gHC_MAGIC (fsLit "inline") inlineIdKey
950
951 -- Base classes (Eq, Ord, Functor)
952 fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name
953 eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey
954 eqName = varQual gHC_CLASSES (fsLit "==") eqClassOpKey
955 ordClassName = clsQual gHC_CLASSES (fsLit "Ord") ordClassKey
956 geName = varQual gHC_CLASSES (fsLit ">=") geClassOpKey
957 functorClassName = clsQual gHC_BASE (fsLit "Functor") functorClassKey
958 fmapName = varQual gHC_BASE (fsLit "fmap") fmapClassOpKey
959
960 -- Class Monad
961 monadClassName, thenMName, bindMName, returnMName, failMName_preMFP :: Name
962 monadClassName = clsQual gHC_BASE (fsLit "Monad") monadClassKey
963 thenMName = varQual gHC_BASE (fsLit ">>") thenMClassOpKey
964 bindMName = varQual gHC_BASE (fsLit ">>=") bindMClassOpKey
965 returnMName = varQual gHC_BASE (fsLit "return") returnMClassOpKey
966 failMName_preMFP = varQual gHC_BASE (fsLit "fail") failMClassOpKey_preMFP
967
968 -- Class MonadFail
969 monadFailClassName, failMName :: Name
970 monadFailClassName = clsQual mONAD_FAIL (fsLit "MonadFail") monadFailClassKey
971 failMName = varQual mONAD_FAIL (fsLit "fail") failMClassOpKey
972
973 -- Class Applicative
974 applicativeClassName, pureAName, apAName, thenAName :: Name
975 applicativeClassName = clsQual gHC_BASE (fsLit "Applicative") applicativeClassKey
976 apAName = varQual gHC_BASE (fsLit "<*>") apAClassOpKey
977 pureAName = varQual gHC_BASE (fsLit "pure") pureAClassOpKey
978 thenAName = varQual gHC_BASE (fsLit "*>") thenAClassOpKey
979
980 -- Classes (Foldable, Traversable)
981 foldableClassName, traversableClassName :: Name
982 foldableClassName = clsQual dATA_FOLDABLE (fsLit "Foldable") foldableClassKey
983 traversableClassName = clsQual dATA_TRAVERSABLE (fsLit "Traversable") traversableClassKey
984
985 -- Classes (Semigroup, Monoid)
986 semigroupClassName, sappendName :: Name
987 semigroupClassName = clsQual dATA_SEMIGROUP (fsLit "Semigroup") semigroupClassKey
988 sappendName = varQual dATA_SEMIGROUP (fsLit "<>") sappendClassOpKey
989 monoidClassName, memptyName, mappendName, mconcatName :: Name
990 monoidClassName = clsQual gHC_BASE (fsLit "Monoid") monoidClassKey
991 memptyName = varQual gHC_BASE (fsLit "mempty") memptyClassOpKey
992 mappendName = varQual gHC_BASE (fsLit "mappend") mappendClassOpKey
993 mconcatName = varQual gHC_BASE (fsLit "mconcat") mconcatClassOpKey
994
995
996
997 -- AMP additions
998
999 joinMName, alternativeClassName :: Name
1000 joinMName = varQual gHC_BASE (fsLit "join") joinMIdKey
1001 alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey
1002
1003 --
1004 joinMIdKey, apAClassOpKey, pureAClassOpKey, thenAClassOpKey,
1005 alternativeClassKey :: Unique
1006 joinMIdKey = mkPreludeMiscIdUnique 750
1007 apAClassOpKey = mkPreludeMiscIdUnique 751 -- <*>
1008 pureAClassOpKey = mkPreludeMiscIdUnique 752
1009 thenAClassOpKey = mkPreludeMiscIdUnique 753
1010 alternativeClassKey = mkPreludeMiscIdUnique 754
1011
1012
1013 -- Functions for GHC extensions
1014 groupWithName :: Name
1015 groupWithName = varQual gHC_EXTS (fsLit "groupWith") groupWithIdKey
1016
1017 -- Random PrelBase functions
1018 fromStringName, otherwiseIdName, foldrName, buildName, augmentName,
1019 mapName, appendName, assertName,
1020 breakpointName, breakpointCondName, breakpointAutoName,
1021 opaqueTyConName :: Name
1022 fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
1023 otherwiseIdName = varQual gHC_BASE (fsLit "otherwise") otherwiseIdKey
1024 foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey
1025 buildName = varQual gHC_BASE (fsLit "build") buildIdKey
1026 augmentName = varQual gHC_BASE (fsLit "augment") augmentIdKey
1027 mapName = varQual gHC_BASE (fsLit "map") mapIdKey
1028 appendName = varQual gHC_BASE (fsLit "++") appendIdKey
1029 assertName = varQual gHC_BASE (fsLit "assert") assertIdKey
1030 breakpointName = varQual gHC_BASE (fsLit "breakpoint") breakpointIdKey
1031 breakpointCondName= varQual gHC_BASE (fsLit "breakpointCond") breakpointCondIdKey
1032 breakpointAutoName= varQual gHC_BASE (fsLit "breakpointAuto") breakpointAutoIdKey
1033 opaqueTyConName = tcQual gHC_BASE (fsLit "Opaque") opaqueTyConKey
1034
1035 breakpointJumpName :: Name
1036 breakpointJumpName
1037 = mkInternalName
1038 breakpointJumpIdKey
1039 (mkOccNameFS varName (fsLit "breakpointJump"))
1040 noSrcSpan
1041 breakpointCondJumpName :: Name
1042 breakpointCondJumpName
1043 = mkInternalName
1044 breakpointCondJumpIdKey
1045 (mkOccNameFS varName (fsLit "breakpointCondJump"))
1046 noSrcSpan
1047 breakpointAutoJumpName :: Name
1048 breakpointAutoJumpName
1049 = mkInternalName
1050 breakpointAutoJumpIdKey
1051 (mkOccNameFS varName (fsLit "breakpointAutoJump"))
1052 noSrcSpan
1053
1054 -- PrelTup
1055 fstName, sndName :: Name
1056 fstName = varQual dATA_TUPLE (fsLit "fst") fstIdKey
1057 sndName = varQual dATA_TUPLE (fsLit "snd") sndIdKey
1058
1059 -- Module GHC.Num
1060 numClassName, fromIntegerName, minusName, negateName :: Name
1061 numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey
1062 fromIntegerName = varQual gHC_NUM (fsLit "fromInteger") fromIntegerClassOpKey
1063 minusName = varQual gHC_NUM (fsLit "-") minusClassOpKey
1064 negateName = varQual gHC_NUM (fsLit "negate") negateClassOpKey
1065
1066 integerTyConName, mkIntegerName, integerSDataConName,
1067 integerToWord64Name, integerToInt64Name,
1068 word64ToIntegerName, int64ToIntegerName,
1069 plusIntegerName, timesIntegerName, smallIntegerName,
1070 wordToIntegerName,
1071 integerToWordName, integerToIntName, minusIntegerName,
1072 negateIntegerName, eqIntegerPrimName, neqIntegerPrimName,
1073 absIntegerName, signumIntegerName,
1074 leIntegerPrimName, gtIntegerPrimName, ltIntegerPrimName, geIntegerPrimName,
1075 compareIntegerName, quotRemIntegerName, divModIntegerName,
1076 quotIntegerName, remIntegerName, divIntegerName, modIntegerName,
1077 floatFromIntegerName, doubleFromIntegerName,
1078 encodeFloatIntegerName, encodeDoubleIntegerName,
1079 decodeDoubleIntegerName,
1080 gcdIntegerName, lcmIntegerName,
1081 andIntegerName, orIntegerName, xorIntegerName, complementIntegerName,
1082 shiftLIntegerName, shiftRIntegerName, bitIntegerName :: Name
1083 integerTyConName = tcQual gHC_INTEGER_TYPE (fsLit "Integer") integerTyConKey
1084 integerSDataConName = dcQual gHC_INTEGER_TYPE (fsLit n) integerSDataConKey
1085 where n = case cIntegerLibraryType of
1086 IntegerGMP -> "S#"
1087 IntegerSimple -> panic "integerSDataConName evaluated for integer-simple"
1088 mkIntegerName = varQual gHC_INTEGER_TYPE (fsLit "mkInteger") mkIntegerIdKey
1089 integerToWord64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToWord64") integerToWord64IdKey
1090 integerToInt64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToInt64") integerToInt64IdKey
1091 word64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "word64ToInteger") word64ToIntegerIdKey
1092 int64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "int64ToInteger") int64ToIntegerIdKey
1093 plusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "plusInteger") plusIntegerIdKey
1094 timesIntegerName = varQual gHC_INTEGER_TYPE (fsLit "timesInteger") timesIntegerIdKey
1095 smallIntegerName = varQual gHC_INTEGER_TYPE (fsLit "smallInteger") smallIntegerIdKey
1096 wordToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "wordToInteger") wordToIntegerIdKey
1097 integerToWordName = varQual gHC_INTEGER_TYPE (fsLit "integerToWord") integerToWordIdKey
1098 integerToIntName = varQual gHC_INTEGER_TYPE (fsLit "integerToInt") integerToIntIdKey
1099 minusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "minusInteger") minusIntegerIdKey
1100 negateIntegerName = varQual gHC_INTEGER_TYPE (fsLit "negateInteger") negateIntegerIdKey
1101 eqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "eqInteger#") eqIntegerPrimIdKey
1102 neqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "neqInteger#") neqIntegerPrimIdKey
1103 absIntegerName = varQual gHC_INTEGER_TYPE (fsLit "absInteger") absIntegerIdKey
1104 signumIntegerName = varQual gHC_INTEGER_TYPE (fsLit "signumInteger") signumIntegerIdKey
1105 leIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "leInteger#") leIntegerPrimIdKey
1106 gtIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "gtInteger#") gtIntegerPrimIdKey
1107 ltIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "ltInteger#") ltIntegerPrimIdKey
1108 geIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "geInteger#") geIntegerPrimIdKey
1109 compareIntegerName = varQual gHC_INTEGER_TYPE (fsLit "compareInteger") compareIntegerIdKey
1110 quotRemIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotRemInteger") quotRemIntegerIdKey
1111 divModIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divModInteger") divModIntegerIdKey
1112 quotIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotInteger") quotIntegerIdKey
1113 remIntegerName = varQual gHC_INTEGER_TYPE (fsLit "remInteger") remIntegerIdKey
1114 divIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divInteger") divIntegerIdKey
1115 modIntegerName = varQual gHC_INTEGER_TYPE (fsLit "modInteger") modIntegerIdKey
1116 floatFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "floatFromInteger") floatFromIntegerIdKey
1117 doubleFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "doubleFromInteger") doubleFromIntegerIdKey
1118 encodeFloatIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeFloatInteger") encodeFloatIntegerIdKey
1119 encodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeDoubleInteger") encodeDoubleIntegerIdKey
1120 decodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "decodeDoubleInteger") decodeDoubleIntegerIdKey
1121 gcdIntegerName = varQual gHC_INTEGER_TYPE (fsLit "gcdInteger") gcdIntegerIdKey
1122 lcmIntegerName = varQual gHC_INTEGER_TYPE (fsLit "lcmInteger") lcmIntegerIdKey
1123 andIntegerName = varQual gHC_INTEGER_TYPE (fsLit "andInteger") andIntegerIdKey
1124 orIntegerName = varQual gHC_INTEGER_TYPE (fsLit "orInteger") orIntegerIdKey
1125 xorIntegerName = varQual gHC_INTEGER_TYPE (fsLit "xorInteger") xorIntegerIdKey
1126 complementIntegerName = varQual gHC_INTEGER_TYPE (fsLit "complementInteger") complementIntegerIdKey
1127 shiftLIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftLInteger") shiftLIntegerIdKey
1128 shiftRIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftRInteger") shiftRIntegerIdKey
1129 bitIntegerName = varQual gHC_INTEGER_TYPE (fsLit "bitInteger") bitIntegerIdKey
1130
1131 -- GHC.Real types and classes
1132 rationalTyConName, ratioTyConName, ratioDataConName, realClassName,
1133 integralClassName, realFracClassName, fractionalClassName,
1134 fromRationalName, toIntegerName, toRationalName, fromIntegralName,
1135 realToFracName :: Name
1136 rationalTyConName = tcQual gHC_REAL (fsLit "Rational") rationalTyConKey
1137 ratioTyConName = tcQual gHC_REAL (fsLit "Ratio") ratioTyConKey
1138 ratioDataConName = dcQual gHC_REAL (fsLit ":%") ratioDataConKey
1139 realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey
1140 integralClassName = clsQual gHC_REAL (fsLit "Integral") integralClassKey
1141 realFracClassName = clsQual gHC_REAL (fsLit "RealFrac") realFracClassKey
1142 fractionalClassName = clsQual gHC_REAL (fsLit "Fractional") fractionalClassKey
1143 fromRationalName = varQual gHC_REAL (fsLit "fromRational") fromRationalClassOpKey
1144 toIntegerName = varQual gHC_REAL (fsLit "toInteger") toIntegerClassOpKey
1145 toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey
1146 fromIntegralName = varQual gHC_REAL (fsLit "fromIntegral")fromIntegralIdKey
1147 realToFracName = varQual gHC_REAL (fsLit "realToFrac") realToFracIdKey
1148
1149 -- PrelFloat classes
1150 floatingClassName, realFloatClassName :: Name
1151 floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey
1152 realFloatClassName = clsQual gHC_FLOAT (fsLit "RealFloat") realFloatClassKey
1153
1154 -- other GHC.Float functions
1155 rationalToFloatName, rationalToDoubleName :: Name
1156 rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey
1157 rationalToDoubleName = varQual gHC_FLOAT (fsLit "rationalToDouble") rationalToDoubleIdKey
1158
1159 -- Class Ix
1160 ixClassName :: Name
1161 ixClassName = clsQual gHC_ARR (fsLit "Ix") ixClassKey
1162
1163 -- Class Typeable, and functions for constructing `Typeable` dictionaries
1164 typeableClassName
1165 , typeRepTyConName
1166 , trTyConDataConName
1167 , trModuleDataConName
1168 , trNameSDataConName
1169 , mkPolyTyConAppName
1170 , mkAppTyName
1171 , typeRepIdName
1172 , typeNatTypeRepName
1173 , typeSymbolTypeRepName
1174 :: Name
1175 typeableClassName = clsQual tYPEABLE_INTERNAL (fsLit "Typeable") typeableClassKey
1176 typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey
1177 trTyConDataConName = dcQual gHC_TYPES (fsLit "TyCon") trTyConDataConKey
1178 trModuleDataConName = dcQual gHC_TYPES (fsLit "Module") trModuleDataConKey
1179 trNameSDataConName = dcQual gHC_TYPES (fsLit "TrNameS") trNameSDataConKey
1180 typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
1181 mkPolyTyConAppName = varQual tYPEABLE_INTERNAL (fsLit "mkPolyTyConApp") mkPolyTyConAppKey
1182 mkAppTyName = varQual tYPEABLE_INTERNAL (fsLit "mkAppTy") mkAppTyKey
1183 typeNatTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeNatTypeRep") typeNatTypeRepKey
1184 typeSymbolTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeSymbolTypeRep") typeSymbolTypeRepKey
1185
1186 -- Custom type errors
1187 errorMessageTypeErrorFamName
1188 , typeErrorTextDataConName
1189 , typeErrorAppendDataConName
1190 , typeErrorVAppendDataConName
1191 , typeErrorShowTypeDataConName
1192 :: Name
1193
1194 errorMessageTypeErrorFamName =
1195 tcQual gHC_TYPELITS (fsLit "TypeError") errorMessageTypeErrorFamKey
1196
1197 typeErrorTextDataConName =
1198 dcQual gHC_TYPELITS (fsLit "Text") typeErrorTextDataConKey
1199
1200 typeErrorAppendDataConName =
1201 dcQual gHC_TYPELITS (fsLit ":<>:") typeErrorAppendDataConKey
1202
1203 typeErrorVAppendDataConName =
1204 dcQual gHC_TYPELITS (fsLit ":$$:") typeErrorVAppendDataConKey
1205
1206 typeErrorShowTypeDataConName =
1207 dcQual gHC_TYPELITS (fsLit "ShowType") typeErrorShowTypeDataConKey
1208
1209
1210
1211 -- Dynamic
1212 toDynName :: Name
1213 toDynName = varQual dYNAMIC (fsLit "toDyn") toDynIdKey
1214
1215 -- Class Data
1216 dataClassName :: Name
1217 dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey
1218
1219 -- Error module
1220 assertErrorName :: Name
1221 assertErrorName = varQual gHC_IO_Exception (fsLit "assertError") assertErrorIdKey
1222
1223 -- Enum module (Enum, Bounded)
1224 enumClassName, enumFromName, enumFromToName, enumFromThenName,
1225 enumFromThenToName, boundedClassName :: Name
1226 enumClassName = clsQual gHC_ENUM (fsLit "Enum") enumClassKey
1227 enumFromName = varQual gHC_ENUM (fsLit "enumFrom") enumFromClassOpKey
1228 enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey
1229 enumFromThenName = varQual gHC_ENUM (fsLit "enumFromThen") enumFromThenClassOpKey
1230 enumFromThenToName = varQual gHC_ENUM (fsLit "enumFromThenTo") enumFromThenToClassOpKey
1231 boundedClassName = clsQual gHC_ENUM (fsLit "Bounded") boundedClassKey
1232
1233 -- List functions
1234 concatName, filterName, zipName :: Name
1235 concatName = varQual gHC_LIST (fsLit "concat") concatIdKey
1236 filterName = varQual gHC_LIST (fsLit "filter") filterIdKey
1237 zipName = varQual gHC_LIST (fsLit "zip") zipIdKey
1238
1239 -- Overloaded lists
1240 isListClassName, fromListName, fromListNName, toListName :: Name
1241 isListClassName = clsQual gHC_EXTS (fsLit "IsList") isListClassKey
1242 fromListName = varQual gHC_EXTS (fsLit "fromList") fromListClassOpKey
1243 fromListNName = varQual gHC_EXTS (fsLit "fromListN") fromListNClassOpKey
1244 toListName = varQual gHC_EXTS (fsLit "toList") toListClassOpKey
1245
1246 -- Class Show
1247 showClassName :: Name
1248 showClassName = clsQual gHC_SHOW (fsLit "Show") showClassKey
1249
1250 -- Class Read
1251 readClassName :: Name
1252 readClassName = clsQual gHC_READ (fsLit "Read") readClassKey
1253
1254 -- Classes Generic and Generic1, Datatype, Constructor and Selector
1255 genClassName, gen1ClassName, datatypeClassName, constructorClassName,
1256 selectorClassName :: Name
1257 genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey
1258 gen1ClassName = clsQual gHC_GENERICS (fsLit "Generic1") gen1ClassKey
1259
1260 datatypeClassName = clsQual gHC_GENERICS (fsLit "Datatype") datatypeClassKey
1261 constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey
1262 selectorClassName = clsQual gHC_GENERICS (fsLit "Selector") selectorClassKey
1263
1264 genericClassNames :: [Name]
1265 genericClassNames = [genClassName, gen1ClassName]
1266
1267 -- GHCi things
1268 ghciIoClassName, ghciStepIoMName :: Name
1269 ghciIoClassName = clsQual gHC_GHCI (fsLit "GHCiSandboxIO") ghciIoClassKey
1270 ghciStepIoMName = varQual gHC_GHCI (fsLit "ghciStepIO") ghciStepIoMClassOpKey
1271
1272 -- IO things
1273 ioTyConName, ioDataConName,
1274 thenIOName, bindIOName, returnIOName, failIOName :: Name
1275 ioTyConName = tcQual gHC_TYPES (fsLit "IO") ioTyConKey
1276 ioDataConName = dcQual gHC_TYPES (fsLit "IO") ioDataConKey
1277 thenIOName = varQual gHC_BASE (fsLit "thenIO") thenIOIdKey
1278 bindIOName = varQual gHC_BASE (fsLit "bindIO") bindIOIdKey
1279 returnIOName = varQual gHC_BASE (fsLit "returnIO") returnIOIdKey
1280 failIOName = varQual gHC_IO (fsLit "failIO") failIOIdKey
1281
1282 -- IO things
1283 printName :: Name
1284 printName = varQual sYSTEM_IO (fsLit "print") printIdKey
1285
1286 -- Int, Word, and Addr things
1287 int8TyConName, int16TyConName, int32TyConName, int64TyConName :: Name
1288 int8TyConName = tcQual gHC_INT (fsLit "Int8") int8TyConKey
1289 int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey
1290 int32TyConName = tcQual gHC_INT (fsLit "Int32") int32TyConKey
1291 int64TyConName = tcQual gHC_INT (fsLit "Int64") int64TyConKey
1292
1293 -- Word module
1294 word16TyConName, word32TyConName, word64TyConName :: Name
1295 word16TyConName = tcQual gHC_WORD (fsLit "Word16") word16TyConKey
1296 word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey
1297 word64TyConName = tcQual gHC_WORD (fsLit "Word64") word64TyConKey
1298
1299 -- PrelPtr module
1300 ptrTyConName, funPtrTyConName :: Name
1301 ptrTyConName = tcQual gHC_PTR (fsLit "Ptr") ptrTyConKey
1302 funPtrTyConName = tcQual gHC_PTR (fsLit "FunPtr") funPtrTyConKey
1303
1304 -- Foreign objects and weak pointers
1305 stablePtrTyConName, newStablePtrName :: Name
1306 stablePtrTyConName = tcQual gHC_STABLE (fsLit "StablePtr") stablePtrTyConKey
1307 newStablePtrName = varQual gHC_STABLE (fsLit "newStablePtr") newStablePtrIdKey
1308
1309 -- Recursive-do notation
1310 monadFixClassName, mfixName :: Name
1311 monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey
1312 mfixName = varQual mONAD_FIX (fsLit "mfix") mfixIdKey
1313
1314 -- Arrow notation
1315 arrAName, composeAName, firstAName, appAName, choiceAName, loopAName :: Name
1316 arrAName = varQual aRROW (fsLit "arr") arrAIdKey
1317 composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey
1318 firstAName = varQual aRROW (fsLit "first") firstAIdKey
1319 appAName = varQual aRROW (fsLit "app") appAIdKey
1320 choiceAName = varQual aRROW (fsLit "|||") choiceAIdKey
1321 loopAName = varQual aRROW (fsLit "loop") loopAIdKey
1322
1323 -- Monad comprehensions
1324 guardMName, liftMName, mzipName :: Name
1325 guardMName = varQual mONAD (fsLit "guard") guardMIdKey
1326 liftMName = varQual mONAD (fsLit "liftM") liftMIdKey
1327 mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey
1328
1329
1330 -- Annotation type checking
1331 toAnnotationWrapperName :: Name
1332 toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey
1333
1334 -- Other classes, needed for type defaulting
1335 monadPlusClassName, randomClassName, randomGenClassName,
1336 isStringClassName :: Name
1337 monadPlusClassName = clsQual mONAD (fsLit "MonadPlus") monadPlusClassKey
1338 randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey
1339 randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey
1340 isStringClassName = clsQual dATA_STRING (fsLit "IsString") isStringClassKey
1341
1342 -- Type-level naturals
1343 knownNatClassName :: Name
1344 knownNatClassName = clsQual gHC_TYPELITS (fsLit "KnownNat") knownNatClassNameKey
1345 knownSymbolClassName :: Name
1346 knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey
1347
1348 -- Overloaded labels
1349 isLabelClassName :: Name
1350 isLabelClassName
1351 = clsQual gHC_OVER_LABELS (fsLit "IsLabel") isLabelClassNameKey
1352
1353 -- Source Locations
1354 callStackDataConName, callStackTyConName, emptyCallStackName, pushCallStackName,
1355 srcLocDataConName :: Name
1356 callStackDataConName
1357 = dcQual gHC_STACK_TYPES (fsLit "CallStack") callStackDataConKey
1358 callStackTyConName
1359 = tcQual gHC_STACK_TYPES (fsLit "CallStack") callStackTyConKey
1360 emptyCallStackName
1361 = varQual gHC_STACK_TYPES (fsLit "emptyCallStack") emptyCallStackKey
1362 pushCallStackName
1363 = varQual gHC_STACK_TYPES (fsLit "pushCallStack") pushCallStackKey
1364 srcLocDataConName
1365 = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey
1366
1367 -- plugins
1368 pLUGINS :: Module
1369 pLUGINS = mkThisGhcModule (fsLit "Plugins")
1370 pluginTyConName :: Name
1371 pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
1372 frontendPluginTyConName :: Name
1373 frontendPluginTyConName = tcQual pLUGINS (fsLit "FrontendPlugin") frontendPluginTyConKey
1374
1375 -- Static pointers
1376 staticPtrInfoTyConName :: Name
1377 staticPtrInfoTyConName =
1378 tcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoTyConKey
1379
1380 staticPtrInfoDataConName :: Name
1381 staticPtrInfoDataConName =
1382 dcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoDataConKey
1383
1384 staticPtrTyConName :: Name
1385 staticPtrTyConName =
1386 tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
1387
1388 staticPtrDataConName :: Name
1389 staticPtrDataConName =
1390 dcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrDataConKey
1391
1392 fingerprintDataConName :: Name
1393 fingerprintDataConName =
1394 dcQual gHC_FINGERPRINT_TYPE (fsLit "Fingerprint") fingerprintDataConKey
1395
1396 -- homogeneous equality. See Note [The equality types story] in TysPrim
1397 eqTyConName :: Name
1398 eqTyConName = tcQual dATA_TYPE_EQUALITY (fsLit "~") eqTyConKey
1399
1400 {-
1401 ************************************************************************
1402 * *
1403 \subsection{Local helpers}
1404 * *
1405 ************************************************************************
1406
1407 All these are original names; hence mkOrig
1408 -}
1409
1410 varQual, tcQual, clsQual, dcQual :: Module -> FastString -> Unique -> Name
1411 varQual = mk_known_key_name varName
1412 tcQual = mk_known_key_name tcName
1413 clsQual = mk_known_key_name clsName
1414 dcQual = mk_known_key_name dataName
1415
1416 mk_known_key_name :: NameSpace -> Module -> FastString -> Unique -> Name
1417 mk_known_key_name space modu str unique
1418 = mkExternalName unique modu (mkOccNameFS space str) noSrcSpan
1419
1420
1421 {-
1422 ************************************************************************
1423 * *
1424 \subsubsection[Uniques-prelude-Classes]{@Uniques@ for wired-in @Classes@}
1425 * *
1426 ************************************************************************
1427 --MetaHaskell extension hand allocate keys here
1428 -}
1429
1430 boundedClassKey, enumClassKey, eqClassKey, floatingClassKey,
1431 fractionalClassKey, integralClassKey, monadClassKey, dataClassKey,
1432 functorClassKey, numClassKey, ordClassKey, readClassKey, realClassKey,
1433 realFloatClassKey, realFracClassKey, showClassKey, ixClassKey :: Unique
1434 boundedClassKey = mkPreludeClassUnique 1
1435 enumClassKey = mkPreludeClassUnique 2
1436 eqClassKey = mkPreludeClassUnique 3
1437 floatingClassKey = mkPreludeClassUnique 5
1438 fractionalClassKey = mkPreludeClassUnique 6
1439 integralClassKey = mkPreludeClassUnique 7
1440 monadClassKey = mkPreludeClassUnique 8
1441 dataClassKey = mkPreludeClassUnique 9
1442 functorClassKey = mkPreludeClassUnique 10
1443 numClassKey = mkPreludeClassUnique 11
1444 ordClassKey = mkPreludeClassUnique 12
1445 readClassKey = mkPreludeClassUnique 13
1446 realClassKey = mkPreludeClassUnique 14
1447 realFloatClassKey = mkPreludeClassUnique 15
1448 realFracClassKey = mkPreludeClassUnique 16
1449 showClassKey = mkPreludeClassUnique 17
1450 ixClassKey = mkPreludeClassUnique 18
1451
1452 typeableClassKey, typeable1ClassKey, typeable2ClassKey, typeable3ClassKey,
1453 typeable4ClassKey, typeable5ClassKey, typeable6ClassKey, typeable7ClassKey
1454 :: Unique
1455 typeableClassKey = mkPreludeClassUnique 20
1456 typeable1ClassKey = mkPreludeClassUnique 21
1457 typeable2ClassKey = mkPreludeClassUnique 22
1458 typeable3ClassKey = mkPreludeClassUnique 23
1459 typeable4ClassKey = mkPreludeClassUnique 24
1460 typeable5ClassKey = mkPreludeClassUnique 25
1461 typeable6ClassKey = mkPreludeClassUnique 26
1462 typeable7ClassKey = mkPreludeClassUnique 27
1463
1464 monadFixClassKey :: Unique
1465 monadFixClassKey = mkPreludeClassUnique 28
1466
1467 monadFailClassKey :: Unique
1468 monadFailClassKey = mkPreludeClassUnique 29
1469
1470 monadPlusClassKey, randomClassKey, randomGenClassKey :: Unique
1471 monadPlusClassKey = mkPreludeClassUnique 30
1472 randomClassKey = mkPreludeClassUnique 31
1473 randomGenClassKey = mkPreludeClassUnique 32
1474
1475 isStringClassKey :: Unique
1476 isStringClassKey = mkPreludeClassUnique 33
1477
1478 applicativeClassKey, foldableClassKey, traversableClassKey :: Unique
1479 applicativeClassKey = mkPreludeClassUnique 34
1480 foldableClassKey = mkPreludeClassUnique 35
1481 traversableClassKey = mkPreludeClassUnique 36
1482
1483 genClassKey, gen1ClassKey, datatypeClassKey, constructorClassKey,
1484 selectorClassKey :: Unique
1485 genClassKey = mkPreludeClassUnique 37
1486 gen1ClassKey = mkPreludeClassUnique 38
1487
1488 datatypeClassKey = mkPreludeClassUnique 39
1489 constructorClassKey = mkPreludeClassUnique 40
1490 selectorClassKey = mkPreludeClassUnique 41
1491
1492 -- KnownNat: see Note [KnowNat & KnownSymbol and EvLit] in TcEvidence
1493 knownNatClassNameKey :: Unique
1494 knownNatClassNameKey = mkPreludeClassUnique 42
1495
1496 -- KnownSymbol: see Note [KnownNat & KnownSymbol and EvLit] in TcEvidence
1497 knownSymbolClassNameKey :: Unique
1498 knownSymbolClassNameKey = mkPreludeClassUnique 43
1499
1500 ghciIoClassKey :: Unique
1501 ghciIoClassKey = mkPreludeClassUnique 44
1502
1503 isLabelClassNameKey :: Unique
1504 isLabelClassNameKey = mkPreludeClassUnique 45
1505
1506 semigroupClassKey, monoidClassKey :: Unique
1507 semigroupClassKey = mkPreludeClassUnique 46
1508 monoidClassKey = mkPreludeClassUnique 47
1509
1510 ---------------- Template Haskell -------------------
1511 -- THNames.hs: USES ClassUniques 200-299
1512 -----------------------------------------------------
1513
1514 {-
1515 ************************************************************************
1516 * *
1517 \subsubsection[Uniques-prelude-TyCons]{@Uniques@ for wired-in @TyCons@}
1518 * *
1519 ************************************************************************
1520 -}
1521
1522 addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey,
1523 byteArrayPrimTyConKey, charPrimTyConKey, charTyConKey, doublePrimTyConKey,
1524 doubleTyConKey, floatPrimTyConKey, floatTyConKey, funTyConKey,
1525 intPrimTyConKey, intTyConKey, int8TyConKey, int16TyConKey,
1526 int32PrimTyConKey, int32TyConKey, int64PrimTyConKey, int64TyConKey,
1527 integerTyConKey, listTyConKey, foreignObjPrimTyConKey, maybeTyConKey,
1528 weakPrimTyConKey, mutableArrayPrimTyConKey, mutableArrayArrayPrimTyConKey,
1529 mutableByteArrayPrimTyConKey, orderingTyConKey, mVarPrimTyConKey,
1530 ratioTyConKey, rationalTyConKey, realWorldTyConKey, stablePtrPrimTyConKey,
1531 stablePtrTyConKey, anyTyConKey, eqTyConKey, heqTyConKey,
1532 smallArrayPrimTyConKey, smallMutableArrayPrimTyConKey :: Unique
1533 addrPrimTyConKey = mkPreludeTyConUnique 1
1534 arrayPrimTyConKey = mkPreludeTyConUnique 3
1535 boolTyConKey = mkPreludeTyConUnique 4
1536 byteArrayPrimTyConKey = mkPreludeTyConUnique 5
1537 charPrimTyConKey = mkPreludeTyConUnique 7
1538 charTyConKey = mkPreludeTyConUnique 8
1539 doublePrimTyConKey = mkPreludeTyConUnique 9
1540 doubleTyConKey = mkPreludeTyConUnique 10
1541 floatPrimTyConKey = mkPreludeTyConUnique 11
1542 floatTyConKey = mkPreludeTyConUnique 12
1543 funTyConKey = mkPreludeTyConUnique 13
1544 intPrimTyConKey = mkPreludeTyConUnique 14
1545 intTyConKey = mkPreludeTyConUnique 15
1546 int8TyConKey = mkPreludeTyConUnique 16
1547 int16TyConKey = mkPreludeTyConUnique 17
1548 int32PrimTyConKey = mkPreludeTyConUnique 18
1549 int32TyConKey = mkPreludeTyConUnique 19
1550 int64PrimTyConKey = mkPreludeTyConUnique 20
1551 int64TyConKey = mkPreludeTyConUnique 21
1552 integerTyConKey = mkPreludeTyConUnique 22
1553
1554 listTyConKey = mkPreludeTyConUnique 24
1555 foreignObjPrimTyConKey = mkPreludeTyConUnique 25
1556 maybeTyConKey = mkPreludeTyConUnique 26
1557 weakPrimTyConKey = mkPreludeTyConUnique 27
1558 mutableArrayPrimTyConKey = mkPreludeTyConUnique 28
1559 mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 29
1560 orderingTyConKey = mkPreludeTyConUnique 30
1561 mVarPrimTyConKey = mkPreludeTyConUnique 31
1562 ratioTyConKey = mkPreludeTyConUnique 32
1563 rationalTyConKey = mkPreludeTyConUnique 33
1564 realWorldTyConKey = mkPreludeTyConUnique 34
1565 stablePtrPrimTyConKey = mkPreludeTyConUnique 35
1566 stablePtrTyConKey = mkPreludeTyConUnique 36
1567 anyTyConKey = mkPreludeTyConUnique 37
1568 eqTyConKey = mkPreludeTyConUnique 38
1569 heqTyConKey = mkPreludeTyConUnique 39
1570 arrayArrayPrimTyConKey = mkPreludeTyConUnique 40
1571 mutableArrayArrayPrimTyConKey = mkPreludeTyConUnique 41
1572
1573 statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey,
1574 mutVarPrimTyConKey, ioTyConKey,
1575 wordPrimTyConKey, wordTyConKey, word8TyConKey, word16TyConKey,
1576 word32PrimTyConKey, word32TyConKey, word64PrimTyConKey, word64TyConKey,
1577 liftedConKey, unliftedConKey, anyBoxConKey, kindConKey, boxityConKey,
1578 typeConKey, threadIdPrimTyConKey, bcoPrimTyConKey, ptrTyConKey,
1579 funPtrTyConKey, tVarPrimTyConKey, eqPrimTyConKey,
1580 eqReprPrimTyConKey, eqPhantPrimTyConKey, voidPrimTyConKey :: Unique
1581 statePrimTyConKey = mkPreludeTyConUnique 50
1582 stableNamePrimTyConKey = mkPreludeTyConUnique 51
1583 stableNameTyConKey = mkPreludeTyConUnique 52
1584 eqPrimTyConKey = mkPreludeTyConUnique 53
1585 eqReprPrimTyConKey = mkPreludeTyConUnique 54
1586 eqPhantPrimTyConKey = mkPreludeTyConUnique 55
1587 mutVarPrimTyConKey = mkPreludeTyConUnique 56
1588 ioTyConKey = mkPreludeTyConUnique 57
1589 voidPrimTyConKey = mkPreludeTyConUnique 58
1590 wordPrimTyConKey = mkPreludeTyConUnique 59
1591 wordTyConKey = mkPreludeTyConUnique 60
1592 word8TyConKey = mkPreludeTyConUnique 61
1593 word16TyConKey = mkPreludeTyConUnique 62
1594 word32PrimTyConKey = mkPreludeTyConUnique 63
1595 word32TyConKey = mkPreludeTyConUnique 64
1596 word64PrimTyConKey = mkPreludeTyConUnique 65
1597 word64TyConKey = mkPreludeTyConUnique 66
1598 liftedConKey = mkPreludeTyConUnique 67
1599 unliftedConKey = mkPreludeTyConUnique 68
1600 anyBoxConKey = mkPreludeTyConUnique 69
1601 kindConKey = mkPreludeTyConUnique 70
1602 boxityConKey = mkPreludeTyConUnique 71
1603 typeConKey = mkPreludeTyConUnique 72
1604 threadIdPrimTyConKey = mkPreludeTyConUnique 73
1605 bcoPrimTyConKey = mkPreludeTyConUnique 74
1606 ptrTyConKey = mkPreludeTyConUnique 75
1607 funPtrTyConKey = mkPreludeTyConUnique 76
1608 tVarPrimTyConKey = mkPreludeTyConUnique 77
1609
1610 -- Parallel array type constructor
1611 parrTyConKey :: Unique
1612 parrTyConKey = mkPreludeTyConUnique 82
1613
1614 -- dotnet interop
1615 objectTyConKey :: Unique
1616 objectTyConKey = mkPreludeTyConUnique 83
1617
1618 eitherTyConKey :: Unique
1619 eitherTyConKey = mkPreludeTyConUnique 84
1620
1621 -- Kind constructors
1622 liftedTypeKindTyConKey, tYPETyConKey,
1623 unliftedTypeKindTyConKey, constraintKindTyConKey, levityTyConKey,
1624 starKindTyConKey, unicodeStarKindTyConKey :: Unique
1625 liftedTypeKindTyConKey = mkPreludeTyConUnique 87
1626 tYPETyConKey = mkPreludeTyConUnique 88
1627 unliftedTypeKindTyConKey = mkPreludeTyConUnique 89
1628 levityTyConKey = mkPreludeTyConUnique 90
1629 constraintKindTyConKey = mkPreludeTyConUnique 92
1630 starKindTyConKey = mkPreludeTyConUnique 93
1631 unicodeStarKindTyConKey = mkPreludeTyConUnique 94
1632
1633 pluginTyConKey, frontendPluginTyConKey :: Unique
1634 pluginTyConKey = mkPreludeTyConUnique 102
1635 frontendPluginTyConKey = mkPreludeTyConUnique 103
1636
1637 unknownTyConKey, unknown1TyConKey, unknown2TyConKey, unknown3TyConKey,
1638 opaqueTyConKey :: Unique
1639 unknownTyConKey = mkPreludeTyConUnique 129
1640 unknown1TyConKey = mkPreludeTyConUnique 130
1641 unknown2TyConKey = mkPreludeTyConUnique 131
1642 unknown3TyConKey = mkPreludeTyConUnique 132
1643 opaqueTyConKey = mkPreludeTyConUnique 133
1644
1645 -- Generics (Unique keys)
1646 v1TyConKey, u1TyConKey, par1TyConKey, rec1TyConKey,
1647 k1TyConKey, m1TyConKey, sumTyConKey, prodTyConKey,
1648 compTyConKey, rTyConKey, dTyConKey,
1649 cTyConKey, sTyConKey, rec0TyConKey,
1650 d1TyConKey, c1TyConKey, s1TyConKey, noSelTyConKey,
1651 repTyConKey, rep1TyConKey, uRecTyConKey,
1652 uAddrTyConKey, uCharTyConKey, uDoubleTyConKey,
1653 uFloatTyConKey, uIntTyConKey, uWordTyConKey :: Unique
1654
1655 v1TyConKey = mkPreludeTyConUnique 135
1656 u1TyConKey = mkPreludeTyConUnique 136
1657 par1TyConKey = mkPreludeTyConUnique 137
1658 rec1TyConKey = mkPreludeTyConUnique 138
1659 k1TyConKey = mkPreludeTyConUnique 139
1660 m1TyConKey = mkPreludeTyConUnique 140
1661
1662 sumTyConKey = mkPreludeTyConUnique 141
1663 prodTyConKey = mkPreludeTyConUnique 142
1664 compTyConKey = mkPreludeTyConUnique 143
1665
1666 rTyConKey = mkPreludeTyConUnique 144
1667 dTyConKey = mkPreludeTyConUnique 146
1668 cTyConKey = mkPreludeTyConUnique 147
1669 sTyConKey = mkPreludeTyConUnique 148
1670
1671 rec0TyConKey = mkPreludeTyConUnique 149
1672 d1TyConKey = mkPreludeTyConUnique 151
1673 c1TyConKey = mkPreludeTyConUnique 152
1674 s1TyConKey = mkPreludeTyConUnique 153
1675 noSelTyConKey = mkPreludeTyConUnique 154
1676
1677 repTyConKey = mkPreludeTyConUnique 155
1678 rep1TyConKey = mkPreludeTyConUnique 156
1679
1680 uRecTyConKey = mkPreludeTyConUnique 157
1681 uAddrTyConKey = mkPreludeTyConUnique 158
1682 uCharTyConKey = mkPreludeTyConUnique 159
1683 uDoubleTyConKey = mkPreludeTyConUnique 160
1684 uFloatTyConKey = mkPreludeTyConUnique 161
1685 uIntTyConKey = mkPreludeTyConUnique 162
1686 uWordTyConKey = mkPreludeTyConUnique 163
1687
1688 -- Type-level naturals
1689 typeNatKindConNameKey, typeSymbolKindConNameKey,
1690 typeNatAddTyFamNameKey, typeNatMulTyFamNameKey, typeNatExpTyFamNameKey,
1691 typeNatLeqTyFamNameKey, typeNatSubTyFamNameKey
1692 , typeSymbolCmpTyFamNameKey, typeNatCmpTyFamNameKey
1693 :: Unique
1694 typeNatKindConNameKey = mkPreludeTyConUnique 164
1695 typeSymbolKindConNameKey = mkPreludeTyConUnique 165
1696 typeNatAddTyFamNameKey = mkPreludeTyConUnique 166
1697 typeNatMulTyFamNameKey = mkPreludeTyConUnique 167
1698 typeNatExpTyFamNameKey = mkPreludeTyConUnique 168
1699 typeNatLeqTyFamNameKey = mkPreludeTyConUnique 169
1700 typeNatSubTyFamNameKey = mkPreludeTyConUnique 170
1701 typeSymbolCmpTyFamNameKey = mkPreludeTyConUnique 171
1702 typeNatCmpTyFamNameKey = mkPreludeTyConUnique 172
1703
1704 -- Custom user type-errors
1705 errorMessageTypeErrorFamKey :: Unique
1706 errorMessageTypeErrorFamKey = mkPreludeTyConUnique 173
1707
1708
1709
1710 ntTyConKey:: Unique
1711 ntTyConKey = mkPreludeTyConUnique 174
1712 coercibleTyConKey :: Unique
1713 coercibleTyConKey = mkPreludeTyConUnique 175
1714
1715 proxyPrimTyConKey :: Unique
1716 proxyPrimTyConKey = mkPreludeTyConUnique 176
1717
1718 specTyConKey :: Unique
1719 specTyConKey = mkPreludeTyConUnique 177
1720
1721 smallArrayPrimTyConKey = mkPreludeTyConUnique 178
1722 smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 179
1723
1724 staticPtrTyConKey :: Unique
1725 staticPtrTyConKey = mkPreludeTyConUnique 180
1726
1727 staticPtrInfoTyConKey :: Unique
1728 staticPtrInfoTyConKey = mkPreludeTyConUnique 181
1729
1730 callStackTyConKey :: Unique
1731 callStackTyConKey = mkPreludeTyConUnique 182
1732
1733 -- Typeables
1734 typeRepTyConKey :: Unique
1735 typeRepTyConKey = mkPreludeTyConUnique 183
1736
1737 -- Implicit Parameters
1738 ipTyConKey :: Unique
1739 ipTyConKey = mkPreludeTyConUnique 184
1740
1741 ipCoNameKey :: Unique
1742 ipCoNameKey = mkPreludeTyConUnique 185
1743
1744 ---------------- Template Haskell -------------------
1745 -- THNames.hs: USES TyConUniques 200-299
1746 -----------------------------------------------------
1747
1748 ----------------------- SIMD ------------------------
1749 -- USES TyConUniques 300-399
1750 -----------------------------------------------------
1751
1752 #include "primop-vector-uniques.hs-incl"
1753
1754 {-
1755 ************************************************************************
1756 * *
1757 \subsubsection[Uniques-prelude-DataCons]{@Uniques@ for wired-in @DataCons@}
1758 * *
1759 ************************************************************************
1760 -}
1761
1762 charDataConKey, consDataConKey, doubleDataConKey, falseDataConKey,
1763 floatDataConKey, intDataConKey, integerSDataConKey, nilDataConKey,
1764 ratioDataConKey, stableNameDataConKey, trueDataConKey, wordDataConKey,
1765 word8DataConKey, ioDataConKey, integerDataConKey, heqDataConKey,
1766 coercibleDataConKey, nothingDataConKey, justDataConKey :: Unique
1767
1768 charDataConKey = mkPreludeDataConUnique 1
1769 consDataConKey = mkPreludeDataConUnique 2
1770 doubleDataConKey = mkPreludeDataConUnique 3
1771 falseDataConKey = mkPreludeDataConUnique 4
1772 floatDataConKey = mkPreludeDataConUnique 5
1773 intDataConKey = mkPreludeDataConUnique 6
1774 integerSDataConKey = mkPreludeDataConUnique 7
1775 nothingDataConKey = mkPreludeDataConUnique 8
1776 justDataConKey = mkPreludeDataConUnique 9
1777 nilDataConKey = mkPreludeDataConUnique 11
1778 ratioDataConKey = mkPreludeDataConUnique 12
1779 word8DataConKey = mkPreludeDataConUnique 13
1780 stableNameDataConKey = mkPreludeDataConUnique 14
1781 trueDataConKey = mkPreludeDataConUnique 15
1782 wordDataConKey = mkPreludeDataConUnique 16
1783 ioDataConKey = mkPreludeDataConUnique 17
1784 integerDataConKey = mkPreludeDataConUnique 18
1785 heqDataConKey = mkPreludeDataConUnique 19
1786
1787 -- Generic data constructors
1788 crossDataConKey, inlDataConKey, inrDataConKey, genUnitDataConKey :: Unique
1789 crossDataConKey = mkPreludeDataConUnique 20
1790 inlDataConKey = mkPreludeDataConUnique 21
1791 inrDataConKey = mkPreludeDataConUnique 22
1792 genUnitDataConKey = mkPreludeDataConUnique 23
1793
1794 -- Data constructor for parallel arrays
1795 parrDataConKey :: Unique
1796 parrDataConKey = mkPreludeDataConUnique 24
1797
1798 leftDataConKey, rightDataConKey :: Unique
1799 leftDataConKey = mkPreludeDataConUnique 25
1800 rightDataConKey = mkPreludeDataConUnique 26
1801
1802 ltDataConKey, eqDataConKey, gtDataConKey :: Unique
1803 ltDataConKey = mkPreludeDataConUnique 27
1804 eqDataConKey = mkPreludeDataConUnique 28
1805 gtDataConKey = mkPreludeDataConUnique 29
1806
1807 coercibleDataConKey = mkPreludeDataConUnique 32
1808
1809 staticPtrDataConKey :: Unique
1810 staticPtrDataConKey = mkPreludeDataConUnique 33
1811
1812 staticPtrInfoDataConKey :: Unique
1813 staticPtrInfoDataConKey = mkPreludeDataConUnique 34
1814
1815 fingerprintDataConKey :: Unique
1816 fingerprintDataConKey = mkPreludeDataConUnique 35
1817
1818 callStackDataConKey, srcLocDataConKey :: Unique
1819 callStackDataConKey = mkPreludeDataConUnique 36
1820 srcLocDataConKey = mkPreludeDataConUnique 37
1821
1822 ipDataConKey :: Unique
1823 ipDataConKey = mkPreludeDataConUnique 38
1824
1825 -- Levity
1826 liftedDataConKey, unliftedDataConKey :: Unique
1827 liftedDataConKey = mkPreludeDataConUnique 39
1828 unliftedDataConKey = mkPreludeDataConUnique 40
1829
1830 trTyConDataConKey, trModuleDataConKey, trNameSDataConKey :: Unique
1831 trTyConDataConKey = mkPreludeDataConUnique 41
1832 trModuleDataConKey = mkPreludeDataConUnique 42
1833 trNameSDataConKey = mkPreludeDataConUnique 43
1834
1835 typeErrorTextDataConKey,
1836 typeErrorAppendDataConKey,
1837 typeErrorVAppendDataConKey,
1838 typeErrorShowTypeDataConKey
1839 :: Unique
1840 typeErrorTextDataConKey = mkPreludeDataConUnique 50
1841 typeErrorAppendDataConKey = mkPreludeDataConUnique 51
1842 typeErrorVAppendDataConKey = mkPreludeDataConUnique 52
1843 typeErrorShowTypeDataConKey = mkPreludeDataConUnique 53
1844
1845 prefixIDataConKey, infixIDataConKey, leftAssociativeDataConKey,
1846 rightAssociativeDataConKey, notAssociativeDataConKey,
1847 sourceUnpackDataConKey, sourceNoUnpackDataConKey,
1848 noSourceUnpackednessDataConKey, sourceLazyDataConKey,
1849 sourceStrictDataConKey, noSourceStrictnessDataConKey,
1850 decidedLazyDataConKey, decidedStrictDataConKey, decidedUnpackDataConKey,
1851 metaDataDataConKey, metaConsDataConKey, metaSelDataConKey :: Unique
1852 prefixIDataConKey = mkPreludeDataConUnique 54
1853 infixIDataConKey = mkPreludeDataConUnique 55
1854 leftAssociativeDataConKey = mkPreludeDataConUnique 56
1855 rightAssociativeDataConKey = mkPreludeDataConUnique 57
1856 notAssociativeDataConKey = mkPreludeDataConUnique 58
1857 sourceUnpackDataConKey = mkPreludeDataConUnique 59
1858 sourceNoUnpackDataConKey = mkPreludeDataConUnique 60
1859 noSourceUnpackednessDataConKey = mkPreludeDataConUnique 61
1860 sourceLazyDataConKey = mkPreludeDataConUnique 62
1861 sourceStrictDataConKey = mkPreludeDataConUnique 63
1862 noSourceStrictnessDataConKey = mkPreludeDataConUnique 64
1863 decidedLazyDataConKey = mkPreludeDataConUnique 65
1864 decidedStrictDataConKey = mkPreludeDataConUnique 66
1865 decidedUnpackDataConKey = mkPreludeDataConUnique 67
1866 metaDataDataConKey = mkPreludeDataConUnique 68
1867 metaConsDataConKey = mkPreludeDataConUnique 69
1868 metaSelDataConKey = mkPreludeDataConUnique 70
1869
1870 ---------------- Template Haskell -------------------
1871 -- THNames.hs: USES DataUniques 100-150
1872 -----------------------------------------------------
1873
1874
1875 {-
1876 ************************************************************************
1877 * *
1878 \subsubsection[Uniques-prelude-Ids]{@Uniques@ for wired-in @Ids@ (except @DataCons@)}
1879 * *
1880 ************************************************************************
1881 -}
1882
1883 wildCardKey, absentErrorIdKey, augmentIdKey, appendIdKey,
1884 buildIdKey, errorIdKey, foldrIdKey, recSelErrorIdKey,
1885 seqIdKey, irrefutPatErrorIdKey, eqStringIdKey,
1886 noMethodBindingErrorIdKey, nonExhaustiveGuardsErrorIdKey,
1887 runtimeErrorIdKey, patErrorIdKey, voidPrimIdKey,
1888 realWorldPrimIdKey, recConErrorIdKey,
1889 unpackCStringUtf8IdKey, unpackCStringAppendIdKey,
1890 unpackCStringFoldrIdKey, unpackCStringIdKey,
1891 typeErrorIdKey :: Unique
1892
1893 wildCardKey = mkPreludeMiscIdUnique 0 -- See Note [WildCard binders]
1894 absentErrorIdKey = mkPreludeMiscIdUnique 1
1895 augmentIdKey = mkPreludeMiscIdUnique 2
1896 appendIdKey = mkPreludeMiscIdUnique 3
1897 buildIdKey = mkPreludeMiscIdUnique 4
1898 errorIdKey = mkPreludeMiscIdUnique 5
1899 foldrIdKey = mkPreludeMiscIdUnique 6
1900 recSelErrorIdKey = mkPreludeMiscIdUnique 7
1901 seqIdKey = mkPreludeMiscIdUnique 8
1902 irrefutPatErrorIdKey = mkPreludeMiscIdUnique 9
1903 eqStringIdKey = mkPreludeMiscIdUnique 10
1904 noMethodBindingErrorIdKey = mkPreludeMiscIdUnique 11
1905 nonExhaustiveGuardsErrorIdKey = mkPreludeMiscIdUnique 12
1906 runtimeErrorIdKey = mkPreludeMiscIdUnique 13
1907 patErrorIdKey = mkPreludeMiscIdUnique 14
1908 realWorldPrimIdKey = mkPreludeMiscIdUnique 15
1909 recConErrorIdKey = mkPreludeMiscIdUnique 16
1910 unpackCStringUtf8IdKey = mkPreludeMiscIdUnique 17
1911 unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18
1912 unpackCStringFoldrIdKey = mkPreludeMiscIdUnique 19
1913 unpackCStringIdKey = mkPreludeMiscIdUnique 20
1914 voidPrimIdKey = mkPreludeMiscIdUnique 21
1915 typeErrorIdKey = mkPreludeMiscIdUnique 22
1916
1917 unsafeCoerceIdKey, concatIdKey, filterIdKey, zipIdKey, bindIOIdKey,
1918 returnIOIdKey, newStablePtrIdKey,
1919 printIdKey, failIOIdKey, nullAddrIdKey, voidArgIdKey,
1920 fstIdKey, sndIdKey, otherwiseIdKey, assertIdKey :: Unique
1921 unsafeCoerceIdKey = mkPreludeMiscIdUnique 30
1922 concatIdKey = mkPreludeMiscIdUnique 31
1923 filterIdKey = mkPreludeMiscIdUnique 32
1924 zipIdKey = mkPreludeMiscIdUnique 33
1925 bindIOIdKey = mkPreludeMiscIdUnique 34
1926 returnIOIdKey = mkPreludeMiscIdUnique 35
1927 newStablePtrIdKey = mkPreludeMiscIdUnique 36
1928 printIdKey = mkPreludeMiscIdUnique 37
1929 failIOIdKey = mkPreludeMiscIdUnique 38
1930 nullAddrIdKey = mkPreludeMiscIdUnique 39
1931 voidArgIdKey = mkPreludeMiscIdUnique 40
1932 fstIdKey = mkPreludeMiscIdUnique 41
1933 sndIdKey = mkPreludeMiscIdUnique 42
1934 otherwiseIdKey = mkPreludeMiscIdUnique 43
1935 assertIdKey = mkPreludeMiscIdUnique 44
1936
1937 mkIntegerIdKey, smallIntegerIdKey, wordToIntegerIdKey,
1938 integerToWordIdKey, integerToIntIdKey,
1939 integerToWord64IdKey, integerToInt64IdKey,
1940 word64ToIntegerIdKey, int64ToIntegerIdKey,
1941 plusIntegerIdKey, timesIntegerIdKey, minusIntegerIdKey,
1942 negateIntegerIdKey,
1943 eqIntegerPrimIdKey, neqIntegerPrimIdKey, absIntegerIdKey, signumIntegerIdKey,
1944 leIntegerPrimIdKey, gtIntegerPrimIdKey, ltIntegerPrimIdKey, geIntegerPrimIdKey,
1945 compareIntegerIdKey, quotRemIntegerIdKey, divModIntegerIdKey,
1946 quotIntegerIdKey, remIntegerIdKey, divIntegerIdKey, modIntegerIdKey,
1947 floatFromIntegerIdKey, doubleFromIntegerIdKey,
1948 encodeFloatIntegerIdKey, encodeDoubleIntegerIdKey,
1949 decodeDoubleIntegerIdKey,
1950 gcdIntegerIdKey, lcmIntegerIdKey,
1951 andIntegerIdKey, orIntegerIdKey, xorIntegerIdKey, complementIntegerIdKey,
1952 shiftLIntegerIdKey, shiftRIntegerIdKey :: Unique
1953 mkIntegerIdKey = mkPreludeMiscIdUnique 60
1954 smallIntegerIdKey = mkPreludeMiscIdUnique 61
1955 integerToWordIdKey = mkPreludeMiscIdUnique 62
1956 integerToIntIdKey = mkPreludeMiscIdUnique 63
1957 integerToWord64IdKey = mkPreludeMiscIdUnique 64
1958 integerToInt64IdKey = mkPreludeMiscIdUnique 65
1959 plusIntegerIdKey = mkPreludeMiscIdUnique 66
1960 timesIntegerIdKey = mkPreludeMiscIdUnique 67
1961 minusIntegerIdKey = mkPreludeMiscIdUnique 68
1962 negateIntegerIdKey = mkPreludeMiscIdUnique 69
1963 eqIntegerPrimIdKey = mkPreludeMiscIdUnique 70
1964 neqIntegerPrimIdKey = mkPreludeMiscIdUnique 71
1965 absIntegerIdKey = mkPreludeMiscIdUnique 72
1966 signumIntegerIdKey = mkPreludeMiscIdUnique 73
1967 leIntegerPrimIdKey = mkPreludeMiscIdUnique 74
1968 gtIntegerPrimIdKey = mkPreludeMiscIdUnique 75
1969 ltIntegerPrimIdKey = mkPreludeMiscIdUnique 76
1970 geIntegerPrimIdKey = mkPreludeMiscIdUnique 77
1971 compareIntegerIdKey = mkPreludeMiscIdUnique 78
1972 quotIntegerIdKey = mkPreludeMiscIdUnique 79
1973 remIntegerIdKey = mkPreludeMiscIdUnique 80
1974 divIntegerIdKey = mkPreludeMiscIdUnique 81
1975 modIntegerIdKey = mkPreludeMiscIdUnique 82
1976 divModIntegerIdKey = mkPreludeMiscIdUnique 83
1977 quotRemIntegerIdKey = mkPreludeMiscIdUnique 84
1978 floatFromIntegerIdKey = mkPreludeMiscIdUnique 85
1979 doubleFromIntegerIdKey = mkPreludeMiscIdUnique 86
1980 encodeFloatIntegerIdKey = mkPreludeMiscIdUnique 87
1981 encodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 88
1982 gcdIntegerIdKey = mkPreludeMiscIdUnique 89
1983 lcmIntegerIdKey = mkPreludeMiscIdUnique 90
1984 andIntegerIdKey = mkPreludeMiscIdUnique 91
1985 orIntegerIdKey = mkPreludeMiscIdUnique 92
1986 xorIntegerIdKey = mkPreludeMiscIdUnique 93
1987 complementIntegerIdKey = mkPreludeMiscIdUnique 94
1988 shiftLIntegerIdKey = mkPreludeMiscIdUnique 95
1989 shiftRIntegerIdKey = mkPreludeMiscIdUnique 96
1990 wordToIntegerIdKey = mkPreludeMiscIdUnique 97
1991 word64ToIntegerIdKey = mkPreludeMiscIdUnique 98
1992 int64ToIntegerIdKey = mkPreludeMiscIdUnique 99
1993 decodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 100
1994
1995 rootMainKey, runMainKey :: Unique
1996 rootMainKey = mkPreludeMiscIdUnique 101
1997 runMainKey = mkPreludeMiscIdUnique 102
1998
1999 thenIOIdKey, lazyIdKey, assertErrorIdKey, oneShotKey, runRWKey :: Unique
2000 thenIOIdKey = mkPreludeMiscIdUnique 103
2001 lazyIdKey = mkPreludeMiscIdUnique 104
2002 assertErrorIdKey = mkPreludeMiscIdUnique 105
2003 oneShotKey = mkPreludeMiscIdUnique 106
2004 runRWKey = mkPreludeMiscIdUnique 107
2005
2006 breakpointIdKey, breakpointCondIdKey, breakpointAutoIdKey,
2007 breakpointJumpIdKey, breakpointCondJumpIdKey,
2008 breakpointAutoJumpIdKey :: Unique
2009 breakpointIdKey = mkPreludeMiscIdUnique 110
2010 breakpointCondIdKey = mkPreludeMiscIdUnique 111
2011 breakpointAutoIdKey = mkPreludeMiscIdUnique 112
2012 breakpointJumpIdKey = mkPreludeMiscIdUnique 113
2013 breakpointCondJumpIdKey = mkPreludeMiscIdUnique 114
2014 breakpointAutoJumpIdKey = mkPreludeMiscIdUnique 115
2015
2016 inlineIdKey :: Unique
2017 inlineIdKey = mkPreludeMiscIdUnique 120
2018
2019 mapIdKey, groupWithIdKey, dollarIdKey :: Unique
2020 mapIdKey = mkPreludeMiscIdUnique 121
2021 groupWithIdKey = mkPreludeMiscIdUnique 122
2022 dollarIdKey = mkPreludeMiscIdUnique 123
2023
2024 coercionTokenIdKey :: Unique
2025 coercionTokenIdKey = mkPreludeMiscIdUnique 124
2026
2027 rationalToFloatIdKey, rationalToDoubleIdKey :: Unique
2028 rationalToFloatIdKey = mkPreludeMiscIdUnique 130
2029 rationalToDoubleIdKey = mkPreludeMiscIdUnique 131
2030
2031 -- dotnet interop
2032 unmarshalObjectIdKey, marshalObjectIdKey, marshalStringIdKey,
2033 unmarshalStringIdKey, checkDotnetResNameIdKey :: Unique
2034 unmarshalObjectIdKey = mkPreludeMiscIdUnique 150
2035 marshalObjectIdKey = mkPreludeMiscIdUnique 151
2036 marshalStringIdKey = mkPreludeMiscIdUnique 152
2037 unmarshalStringIdKey = mkPreludeMiscIdUnique 153
2038 checkDotnetResNameIdKey = mkPreludeMiscIdUnique 154
2039
2040 undefinedKey :: Unique
2041 undefinedKey = mkPreludeMiscIdUnique 155
2042
2043 magicDictKey :: Unique
2044 magicDictKey = mkPreludeMiscIdUnique 156
2045
2046 coerceKey :: Unique
2047 coerceKey = mkPreludeMiscIdUnique 157
2048
2049 {-
2050 Certain class operations from Prelude classes. They get their own
2051 uniques so we can look them up easily when we want to conjure them up
2052 during type checking.
2053 -}
2054
2055 -- Just a placeholder for unbound variables produced by the renamer:
2056 unboundKey :: Unique
2057 unboundKey = mkPreludeMiscIdUnique 158
2058
2059 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey,
2060 enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey,
2061 enumFromThenToClassOpKey, eqClassOpKey, geClassOpKey, negateClassOpKey,
2062 failMClassOpKey_preMFP, bindMClassOpKey, thenMClassOpKey, returnMClassOpKey,
2063 fmapClassOpKey
2064 :: Unique
2065 fromIntegerClassOpKey = mkPreludeMiscIdUnique 160
2066 minusClassOpKey = mkPreludeMiscIdUnique 161
2067 fromRationalClassOpKey = mkPreludeMiscIdUnique 162
2068 enumFromClassOpKey = mkPreludeMiscIdUnique 163
2069 enumFromThenClassOpKey = mkPreludeMiscIdUnique 164
2070 enumFromToClassOpKey = mkPreludeMiscIdUnique 165
2071 enumFromThenToClassOpKey = mkPreludeMiscIdUnique 166
2072 eqClassOpKey = mkPreludeMiscIdUnique 167
2073 geClassOpKey = mkPreludeMiscIdUnique 168
2074 negateClassOpKey = mkPreludeMiscIdUnique 169
2075 failMClassOpKey_preMFP = mkPreludeMiscIdUnique 170
2076 bindMClassOpKey = mkPreludeMiscIdUnique 171 -- (>>=)
2077 thenMClassOpKey = mkPreludeMiscIdUnique 172 -- (>>)
2078 fmapClassOpKey = mkPreludeMiscIdUnique 173
2079 returnMClassOpKey = mkPreludeMiscIdUnique 174
2080
2081 -- Recursive do notation
2082 mfixIdKey :: Unique
2083 mfixIdKey = mkPreludeMiscIdUnique 175
2084
2085 -- MonadFail operations
2086 failMClassOpKey :: Unique
2087 failMClassOpKey = mkPreludeMiscIdUnique 176
2088
2089 -- Arrow notation
2090 arrAIdKey, composeAIdKey, firstAIdKey, appAIdKey, choiceAIdKey,
2091 loopAIdKey :: Unique
2092 arrAIdKey = mkPreludeMiscIdUnique 180
2093 composeAIdKey = mkPreludeMiscIdUnique 181 -- >>>
2094 firstAIdKey = mkPreludeMiscIdUnique 182
2095 appAIdKey = mkPreludeMiscIdUnique 183
2096 choiceAIdKey = mkPreludeMiscIdUnique 184 -- |||
2097 loopAIdKey = mkPreludeMiscIdUnique 185
2098
2099 fromStringClassOpKey :: Unique
2100 fromStringClassOpKey = mkPreludeMiscIdUnique 186
2101
2102 -- Annotation type checking
2103 toAnnotationWrapperIdKey :: Unique
2104 toAnnotationWrapperIdKey = mkPreludeMiscIdUnique 187
2105
2106 -- Conversion functions
2107 fromIntegralIdKey, realToFracIdKey, toIntegerClassOpKey, toRationalClassOpKey :: Unique
2108 fromIntegralIdKey = mkPreludeMiscIdUnique 190
2109 realToFracIdKey = mkPreludeMiscIdUnique 191
2110 toIntegerClassOpKey = mkPreludeMiscIdUnique 192
2111 toRationalClassOpKey = mkPreludeMiscIdUnique 193
2112
2113 -- Monad comprehensions
2114 guardMIdKey, liftMIdKey, mzipIdKey :: Unique
2115 guardMIdKey = mkPreludeMiscIdUnique 194
2116 liftMIdKey = mkPreludeMiscIdUnique 195
2117 mzipIdKey = mkPreludeMiscIdUnique 196
2118
2119 -- GHCi
2120 ghciStepIoMClassOpKey :: Unique
2121 ghciStepIoMClassOpKey = mkPreludeMiscIdUnique 197
2122
2123 -- Overloaded lists
2124 isListClassKey, fromListClassOpKey, fromListNClassOpKey, toListClassOpKey :: Unique
2125 isListClassKey = mkPreludeMiscIdUnique 198
2126 fromListClassOpKey = mkPreludeMiscIdUnique 199
2127 fromListNClassOpKey = mkPreludeMiscIdUnique 500
2128 toListClassOpKey = mkPreludeMiscIdUnique 501
2129
2130 proxyHashKey :: Unique
2131 proxyHashKey = mkPreludeMiscIdUnique 502
2132
2133 ---------------- Template Haskell -------------------
2134 -- THNames.hs: USES IdUniques 200-499
2135 -----------------------------------------------------
2136
2137 -- Used to make `Typeable` dictionaries
2138 mkTyConKey
2139 , mkPolyTyConAppKey
2140 , mkAppTyKey
2141 , typeNatTypeRepKey
2142 , typeSymbolTypeRepKey
2143 , typeRepIdKey
2144 :: Unique
2145 mkTyConKey = mkPreludeMiscIdUnique 503
2146 mkPolyTyConAppKey = mkPreludeMiscIdUnique 504
2147 mkAppTyKey = mkPreludeMiscIdUnique 505
2148 typeNatTypeRepKey = mkPreludeMiscIdUnique 506
2149 typeSymbolTypeRepKey = mkPreludeMiscIdUnique 507
2150 typeRepIdKey = mkPreludeMiscIdUnique 508
2151
2152 -- Dynamic
2153 toDynIdKey :: Unique
2154 toDynIdKey = mkPreludeMiscIdUnique 509
2155
2156 bitIntegerIdKey :: Unique
2157 bitIntegerIdKey = mkPreludeMiscIdUnique 510
2158
2159 heqSCSelIdKey, coercibleSCSelIdKey :: Unique
2160 heqSCSelIdKey = mkPreludeMiscIdUnique 511
2161 coercibleSCSelIdKey = mkPreludeMiscIdUnique 512
2162
2163 sappendClassOpKey :: Unique
2164 sappendClassOpKey = mkPreludeMiscIdUnique 513
2165
2166 memptyClassOpKey, mappendClassOpKey, mconcatClassOpKey :: Unique
2167 memptyClassOpKey = mkPreludeMiscIdUnique 514
2168 mappendClassOpKey = mkPreludeMiscIdUnique 515
2169 mconcatClassOpKey = mkPreludeMiscIdUnique 516
2170
2171 emptyCallStackKey, pushCallStackKey :: Unique
2172 emptyCallStackKey = mkPreludeMiscIdUnique 517
2173 pushCallStackKey = mkPreludeMiscIdUnique 518
2174
2175 {-
2176 ************************************************************************
2177 * *
2178 \subsection[Class-std-groups]{Standard groups of Prelude classes}
2179 * *
2180 ************************************************************************
2181
2182 NOTE: @Eq@ and @Text@ do need to appear in @standardClasses@
2183 even though every numeric class has these two as a superclass,
2184 because the list of ambiguous dictionaries hasn't been simplified.
2185 -}
2186
2187 numericClassKeys :: [Unique]
2188 numericClassKeys =
2189 [ numClassKey
2190 , realClassKey
2191 , integralClassKey
2192 ]
2193 ++ fractionalClassKeys
2194
2195 fractionalClassKeys :: [Unique]
2196 fractionalClassKeys =
2197 [ fractionalClassKey
2198 , floatingClassKey
2199 , realFracClassKey
2200 , realFloatClassKey
2201 ]
2202
2203 -- The "standard classes" are used in defaulting (Haskell 98 report 4.3.4),
2204 -- and are: "classes defined in the Prelude or a standard library"
2205 standardClassKeys :: [Unique]
2206 standardClassKeys = derivableClassKeys ++ numericClassKeys
2207 ++ [randomClassKey, randomGenClassKey,
2208 functorClassKey,
2209 monadClassKey, monadPlusClassKey, monadFailClassKey,
2210 semigroupClassKey, monoidClassKey,
2211 isStringClassKey,
2212 applicativeClassKey, foldableClassKey,
2213 traversableClassKey, alternativeClassKey
2214 ]
2215
2216 {-
2217 @derivableClassKeys@ is also used in checking \tr{deriving} constructs
2218 (@TcDeriv@).
2219 -}
2220
2221 derivableClassKeys :: [Unique]
2222 derivableClassKeys
2223 = [ eqClassKey, ordClassKey, enumClassKey, ixClassKey,
2224 boundedClassKey, showClassKey, readClassKey ]
2225
2226 {-
2227 ************************************************************************
2228 * *
2229 Semi-builtin names
2230 * *
2231 ************************************************************************
2232
2233 The following names should be considered by GHCi to be in scope always.
2234
2235 -}
2236
2237 pretendNameIsInScope :: Name -> Bool
2238 pretendNameIsInScope n
2239 = any (n `hasKey`)
2240 [ starKindTyConKey, liftedTypeKindTyConKey, tYPETyConKey
2241 , unliftedTypeKindTyConKey, levityTyConKey, liftedDataConKey
2242 , unliftedDataConKey ]