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