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