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