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