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