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