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