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