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