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