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