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