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