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