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