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