1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
|
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
\section[PrelNames]{Definitions of prelude modules and names}
Nota Bene: all Names defined in here should come from the base package
* ModuleNames for prelude modules,
e.g. pREL_BASE_Name :: ModuleName
* Modules for prelude modules
e.g. pREL_Base :: Module
* Uniques for Ids, DataCons, TyCons and Classes that the compiler
"knows about" in some way
e.g. intTyConKey :: Unique
minusClassOpKey :: Unique
* Names for Ids, DataCons, TyCons and Classes that the compiler
"knows about" in some way
e.g. intTyConName :: Name
minusName :: Name
One of these Names contains
(a) the module and occurrence name of the thing
(b) its Unique
The may way the compiler "knows about" one of these things is
where the type checker or desugarer needs to look it up. For
example, when desugaring list comprehensions the desugarer
needs to conjure up 'foldr'. It does this by looking up
foldrName in the environment.
* RdrNames for Ids, DataCons etc that the compiler may emit into
generated code (e.g. for deriving). It's not necessary to know
the uniques for these guys, only their names
\begin{code}
module PrelNames (
Unique, Uniquable(..), hasKey, -- Re-exported for convenience
-----------------------------------------------------------
module PrelNames, -- A huge bunch of (a) Names, e.g. intTyConName
-- (b) Uniques e.g. intTyConKey
-- (c) Groups of classes and types
-- (d) miscellaneous things
-- So many that we export them all
) where
#include "HsVersions.h"
import Module ( Module, mkModule )
import OccName ( dataName, tcName, clsName, varName, mkOccNameFS,
mkVarOccFS )
import RdrName ( RdrName, nameRdrName, mkOrig, rdrNameOcc, mkUnqual )
import Unique ( Unique, Uniquable(..), hasKey,
mkPreludeMiscIdUnique, mkPreludeDataConUnique,
mkPreludeTyConUnique, mkPreludeClassUnique,
mkTupleTyConUnique
)
import BasicTypes ( Boxity(..), Arity )
import Name ( Name, mkInternalName, mkExternalName, nameModule )
import SrcLoc ( noSrcLoc )
import FastString
\end{code}
%************************************************************************
%* *
\subsection{Local Names}
%* *
%************************************************************************
This *local* name is used by the interactive stuff
\begin{code}
itName uniq = mkInternalName uniq (mkOccNameFS varName FSLIT("it")) noSrcLoc
\end{code}
\begin{code}
-- mkUnboundName makes a place-holder Name; it shouldn't be looked at except possibly
-- during compiler debugging.
mkUnboundName :: RdrName -> Name
mkUnboundName rdr_name = mkInternalName unboundKey (rdrNameOcc rdr_name) noSrcLoc
isUnboundName :: Name -> Bool
isUnboundName name = name `hasKey` unboundKey
\end{code}
%************************************************************************
%* *
\subsection{Known key Names}
%* *
%************************************************************************
This section tells what the compiler knows about the assocation of
names with uniques. These ones are the *non* wired-in ones. The
wired in ones are defined in TysWiredIn etc.
\begin{code}
basicKnownKeyNames :: [Name]
basicKnownKeyNames
= genericTyConNames
++ typeableClassNames
++ [ -- Type constructors (synonyms especially)
ioTyConName, ioDataConName,
runMainIOName,
orderingTyConName,
rationalTyConName,
ratioDataConName,
ratioTyConName,
byteArrayTyConName,
mutableByteArrayTyConName,
integerTyConName, smallIntegerDataConName, largeIntegerDataConName,
-- Classes. *Must* include:
-- classes that are grabbed by key (e.g., eqClassKey)
-- classes in "Class.standardClassKeys" (quite a few)
eqClassName, -- mentioned, derivable
ordClassName, -- derivable
boundedClassName, -- derivable
numClassName, -- mentioned, numeric
enumClassName, -- derivable
monadClassName,
functorClassName,
realClassName, -- numeric
integralClassName, -- numeric
fractionalClassName, -- numeric
floatingClassName, -- numeric
realFracClassName, -- numeric
realFloatClassName, -- numeric
dataClassName,
-- Numeric stuff
negateName, minusName,
fromRationalName, fromIntegerName,
geName, eqName,
-- Enum stuff
enumFromName, enumFromThenName,
enumFromThenToName, enumFromToName,
enumFromToPName, enumFromThenToPName,
-- Monad stuff
thenIOName, bindIOName, returnIOName, failIOName,
failMName, bindMName, thenMName, returnMName,
-- MonadRec stuff
mfixName,
-- Arrow stuff
arrAName, composeAName, firstAName,
appAName, choiceAName, loopAName,
-- Ix stuff
ixClassName,
-- Show stuff
showClassName,
-- Read stuff
readClassName,
-- Stable pointers
newStablePtrName,
-- Strings and lists
unpackCStringName, unpackCStringAppendName,
unpackCStringFoldrName, unpackCStringUtf8Name,
-- List operations
concatName, filterName,
zipName, foldrName, buildName, augmentName, appendName,
-- Parallel array operations
nullPName, lengthPName, replicatePName, mapPName,
filterPName, zipPName, crossPName, indexPName,
toPName, bpermutePName, bpermuteDftPName, indexOfPName,
-- FFI primitive types that are not wired-in.
stablePtrTyConName, ptrTyConName, funPtrTyConName, addrTyConName,
int8TyConName, int16TyConName, int32TyConName, int64TyConName,
wordTyConName, word8TyConName, word16TyConName, word32TyConName, word64TyConName,
-- Others
otherwiseIdName,
plusIntegerName, timesIntegerName,
eqStringName, assertName, breakpointName, assertErrorName,
runSTRepName,
printName, fstName, sndName,
-- MonadFix
monadFixClassName, mfixName,
-- Splittable class
splittableClassName, splitName,
-- Other classes
randomClassName, randomGenClassName, monadPlusClassName,
-- Booleans
andName, orName
-- The Either type
, eitherTyConName, leftDataConName, rightDataConName
-- dotnet interop
, objectTyConName, marshalObjectName, unmarshalObjectName
, marshalStringName, unmarshalStringName, checkDotnetResName
]
genericTyConNames :: [Name]
genericTyConNames = [crossTyConName, plusTyConName, genUnitTyConName]
\end{code}
%************************************************************************
%* *
\subsection{Module names}
%* *
%************************************************************************
--MetaHaskell Extension Add a new module here
\begin{code}
pRELUDE = mkModule "Prelude"
gHC_PRIM = mkModule "GHC.Prim" -- Primitive types and values
pREL_BASE = mkModule "GHC.Base"
pREL_ENUM = mkModule "GHC.Enum"
pREL_SHOW = mkModule "GHC.Show"
pREL_READ = mkModule "GHC.Read"
pREL_NUM = mkModule "GHC.Num"
pREL_LIST = mkModule "GHC.List"
pREL_PARR = mkModule "GHC.PArr"
pREL_TUP = mkModule "Data.Tuple"
pREL_EITHER = mkModule "Data.Either"
pREL_PACK = mkModule "GHC.Pack"
pREL_CONC = mkModule "GHC.Conc"
pREL_IO_BASE = mkModule "GHC.IOBase"
pREL_ST = mkModule "GHC.ST"
pREL_ARR = mkModule "GHC.Arr"
pREL_BYTEARR = mkModule "PrelByteArr"
pREL_STABLE = mkModule "GHC.Stable"
pREL_ADDR = mkModule "GHC.Addr"
pREL_PTR = mkModule "GHC.Ptr"
pREL_ERR = mkModule "GHC.Err"
pREL_REAL = mkModule "GHC.Real"
pREL_FLOAT = mkModule "GHC.Float"
pREL_TOP_HANDLER= mkModule "GHC.TopHandler"
sYSTEM_IO = mkModule "System.IO"
dYNAMIC = mkModule "Data.Dynamic"
tYPEABLE = mkModule "Data.Typeable"
gENERICS = mkModule "Data.Generics.Basics"
dOTNET = mkModule "GHC.Dotnet"
rEAD_PREC = mkModule "Text.ParserCombinators.ReadPrec"
lEX = mkModule "Text.Read.Lex"
mAIN = mkModule "Main"
pREL_INT = mkModule "GHC.Int"
pREL_WORD = mkModule "GHC.Word"
mONAD = mkModule "Control.Monad"
mONAD_FIX = mkModule "Control.Monad.Fix"
aRROW = mkModule "Control.Arrow"
aDDR = mkModule "Addr"
rANDOM = mkModule "System.Random"
gLA_EXTS = mkModule "GHC.Exts"
rOOT_MAIN = mkModule ":Main" -- Root module for initialisation
-- The ':xxx' makes a module name that the user can never
-- use himself. The z-encoding for ':' is "ZC", so the z-encoded
-- module name still starts with a capital letter, which keeps
-- the z-encoded version consistent.
iNTERACTIVE = mkModule ":Interactive"
thFAKE = mkModule ":THFake"
\end{code}
%************************************************************************
%* *
\subsection{Constructing the names of tuples
%* *
%************************************************************************
\begin{code}
mkTupleModule :: Boxity -> Arity -> Module
mkTupleModule Boxed 0 = pREL_BASE
mkTupleModule Boxed _ = pREL_TUP
mkTupleModule Unboxed _ = gHC_PRIM
\end{code}
%************************************************************************
%* *
RdrNames
%* *
%************************************************************************
\begin{code}
main_RDR_Unqual = mkUnqual varName FSLIT("main")
-- We definitely don't want an Orig RdrName, because
-- main might, in principle, be imported into module Main
eq_RDR = nameRdrName eqName
ge_RDR = nameRdrName geName
ne_RDR = varQual_RDR pREL_BASE FSLIT("/=")
le_RDR = varQual_RDR pREL_BASE FSLIT("<=")
gt_RDR = varQual_RDR pREL_BASE FSLIT(">")
compare_RDR = varQual_RDR pREL_BASE FSLIT("compare")
ltTag_RDR = dataQual_RDR pREL_BASE FSLIT("LT")
eqTag_RDR = dataQual_RDR pREL_BASE FSLIT("EQ")
gtTag_RDR = dataQual_RDR pREL_BASE FSLIT("GT")
eqClass_RDR = nameRdrName eqClassName
numClass_RDR = nameRdrName numClassName
ordClass_RDR = nameRdrName ordClassName
enumClass_RDR = nameRdrName enumClassName
monadClass_RDR = nameRdrName monadClassName
map_RDR = varQual_RDR pREL_BASE FSLIT("map")
append_RDR = varQual_RDR pREL_BASE FSLIT("++")
foldr_RDR = nameRdrName foldrName
build_RDR = nameRdrName buildName
returnM_RDR = nameRdrName returnMName
bindM_RDR = nameRdrName bindMName
failM_RDR = nameRdrName failMName
and_RDR = nameRdrName andName
left_RDR = nameRdrName leftDataConName
right_RDR = nameRdrName rightDataConName
fromEnum_RDR = varQual_RDR pREL_ENUM FSLIT("fromEnum")
toEnum_RDR = varQual_RDR pREL_ENUM FSLIT("toEnum")
enumFrom_RDR = nameRdrName enumFromName
enumFromTo_RDR = nameRdrName enumFromToName
enumFromThen_RDR = nameRdrName enumFromThenName
enumFromThenTo_RDR = nameRdrName enumFromThenToName
ratioDataCon_RDR = nameRdrName ratioDataConName
plusInteger_RDR = nameRdrName plusIntegerName
timesInteger_RDR = nameRdrName timesIntegerName
ioDataCon_RDR = nameRdrName ioDataConName
eqString_RDR = nameRdrName eqStringName
unpackCString_RDR = nameRdrName unpackCStringName
unpackCStringFoldr_RDR = nameRdrName unpackCStringFoldrName
unpackCStringUtf8_RDR = nameRdrName unpackCStringUtf8Name
newStablePtr_RDR = nameRdrName newStablePtrName
addrDataCon_RDR = dataQual_RDR aDDR FSLIT("A#")
wordDataCon_RDR = dataQual_RDR pREL_WORD FSLIT("W#")
bindIO_RDR = nameRdrName bindIOName
returnIO_RDR = nameRdrName returnIOName
fromInteger_RDR = nameRdrName fromIntegerName
fromRational_RDR = nameRdrName fromRationalName
minus_RDR = nameRdrName minusName
times_RDR = varQual_RDR pREL_NUM FSLIT("*")
plus_RDR = varQual_RDR pREL_NUM FSLIT("+")
compose_RDR = varQual_RDR pREL_BASE FSLIT(".")
not_RDR = varQual_RDR pREL_BASE FSLIT("not")
getTag_RDR = varQual_RDR pREL_BASE FSLIT("getTag")
succ_RDR = varQual_RDR pREL_ENUM FSLIT("succ")
pred_RDR = varQual_RDR pREL_ENUM FSLIT("pred")
minBound_RDR = varQual_RDR pREL_ENUM FSLIT("minBound")
maxBound_RDR = varQual_RDR pREL_ENUM FSLIT("maxBound")
range_RDR = varQual_RDR pREL_ARR FSLIT("range")
inRange_RDR = varQual_RDR pREL_ARR FSLIT("inRange")
index_RDR = varQual_RDR pREL_ARR FSLIT("index")
unsafeIndex_RDR = varQual_RDR pREL_ARR FSLIT("unsafeIndex")
unsafeRangeSize_RDR = varQual_RDR pREL_ARR FSLIT("unsafeRangeSize")
readList_RDR = varQual_RDR pREL_READ FSLIT("readList")
readListDefault_RDR = varQual_RDR pREL_READ FSLIT("readListDefault")
readListPrec_RDR = varQual_RDR pREL_READ FSLIT("readListPrec")
readListPrecDefault_RDR = varQual_RDR pREL_READ FSLIT("readListPrecDefault")
readPrec_RDR = varQual_RDR pREL_READ FSLIT("readPrec")
parens_RDR = varQual_RDR pREL_READ FSLIT("parens")
choose_RDR = varQual_RDR pREL_READ FSLIT("choose")
lexP_RDR = varQual_RDR pREL_READ FSLIT("lexP")
punc_RDR = dataQual_RDR lEX FSLIT("Punc")
ident_RDR = dataQual_RDR lEX FSLIT("Ident")
symbol_RDR = dataQual_RDR lEX FSLIT("Symbol")
step_RDR = varQual_RDR rEAD_PREC FSLIT("step")
alt_RDR = varQual_RDR rEAD_PREC FSLIT("+++")
reset_RDR = varQual_RDR rEAD_PREC FSLIT("reset")
prec_RDR = varQual_RDR rEAD_PREC FSLIT("prec")
showList_RDR = varQual_RDR pREL_SHOW FSLIT("showList")
showList___RDR = varQual_RDR pREL_SHOW FSLIT("showList__")
showsPrec_RDR = varQual_RDR pREL_SHOW FSLIT("showsPrec")
showString_RDR = varQual_RDR pREL_SHOW FSLIT("showString")
showSpace_RDR = varQual_RDR pREL_SHOW FSLIT("showSpace")
showParen_RDR = varQual_RDR pREL_SHOW FSLIT("showParen")
typeOf_RDR = varQual_RDR tYPEABLE FSLIT("typeOf")
mkTypeRep_RDR = varQual_RDR tYPEABLE FSLIT("mkTyConApp")
mkTyConRep_RDR = varQual_RDR tYPEABLE FSLIT("mkTyCon")
undefined_RDR = varQual_RDR pREL_ERR FSLIT("undefined")
crossDataCon_RDR = dataQual_RDR pREL_BASE FSLIT(":*:")
inlDataCon_RDR = dataQual_RDR pREL_BASE FSLIT("Inl")
inrDataCon_RDR = dataQual_RDR pREL_BASE FSLIT("Inr")
genUnitDataCon_RDR = dataQual_RDR pREL_BASE FSLIT("Unit")
----------------------
varQual_RDR mod str = mkOrig mod (mkOccNameFS varName str)
tcQual_RDR mod str = mkOrig mod (mkOccNameFS tcName str)
clsQual_RDR mod str = mkOrig mod (mkOccNameFS clsName str)
dataQual_RDR mod str = mkOrig mod (mkOccNameFS dataName str)
\end{code}
%************************************************************************
%* *
\subsection{Known-key names}
%* *
%************************************************************************
Many of these Names are not really "built in", but some parts of the
compiler (notably the deriving mechanism) need to mention their names,
and it's convenient to write them all down in one place.
--MetaHaskell Extension add the constrs and the lower case case
-- guys as well (perhaps) e.g. see trueDataConName below
\begin{code}
runMainIOName = varQual pREL_TOP_HANDLER FSLIT("runMainIO") runMainKey
orderingTyConName = tcQual pREL_BASE FSLIT("Ordering") orderingTyConKey
eitherTyConName = tcQual pREL_EITHER FSLIT("Either") eitherTyConKey
leftDataConName = conName eitherTyConName FSLIT("Left") leftDataConKey
rightDataConName = conName eitherTyConName FSLIT("Right") rightDataConKey
-- Generics
crossTyConName = tcQual pREL_BASE FSLIT(":*:") crossTyConKey
plusTyConName = tcQual pREL_BASE FSLIT(":+:") plusTyConKey
genUnitTyConName = tcQual pREL_BASE FSLIT("Unit") genUnitTyConKey
-- Base strings Strings
unpackCStringName = varQual pREL_BASE FSLIT("unpackCString#") unpackCStringIdKey
unpackCStringAppendName = varQual pREL_BASE FSLIT("unpackAppendCString#") unpackCStringAppendIdKey
unpackCStringFoldrName = varQual pREL_BASE FSLIT("unpackFoldrCString#") unpackCStringFoldrIdKey
unpackCStringUtf8Name = varQual pREL_BASE FSLIT("unpackCStringUtf8#") unpackCStringUtf8IdKey
eqStringName = varQual pREL_BASE FSLIT("eqString") eqStringIdKey
-- Base classes (Eq, Ord, Functor)
eqClassName = clsQual pREL_BASE FSLIT("Eq") eqClassKey
eqName = methName eqClassName FSLIT("==") eqClassOpKey
ordClassName = clsQual pREL_BASE FSLIT("Ord") ordClassKey
geName = methName ordClassName FSLIT(">=") geClassOpKey
functorClassName = clsQual pREL_BASE FSLIT("Functor") functorClassKey
-- Class Monad
monadClassName = clsQual pREL_BASE FSLIT("Monad") monadClassKey
thenMName = methName monadClassName FSLIT(">>") thenMClassOpKey
bindMName = methName monadClassName FSLIT(">>=") bindMClassOpKey
returnMName = methName monadClassName FSLIT("return") returnMClassOpKey
failMName = methName monadClassName FSLIT("fail") failMClassOpKey
-- Random PrelBase functions
otherwiseIdName = varQual pREL_BASE FSLIT("otherwise") otherwiseIdKey
foldrName = varQual pREL_BASE FSLIT("foldr") foldrIdKey
buildName = varQual pREL_BASE FSLIT("build") buildIdKey
augmentName = varQual pREL_BASE FSLIT("augment") augmentIdKey
appendName = varQual pREL_BASE FSLIT("++") appendIdKey
andName = varQual pREL_BASE FSLIT("&&") andIdKey
orName = varQual pREL_BASE FSLIT("||") orIdKey
assertName = varQual pREL_BASE FSLIT("assert") assertIdKey
breakpointName = varQual pREL_BASE FSLIT("breakpoint") breakpointIdKey
breakpointJumpName
= mkInternalName
breakpointJumpIdKey
(mkOccNameFS varName FSLIT("breakpointJump"))
noSrcLoc
-- PrelTup
fstName = varQual pREL_TUP FSLIT("fst") fstIdKey
sndName = varQual pREL_TUP FSLIT("snd") sndIdKey
-- Module PrelNum
numClassName = clsQual pREL_NUM FSLIT("Num") numClassKey
fromIntegerName = methName numClassName FSLIT("fromInteger") fromIntegerClassOpKey
minusName = methName numClassName FSLIT("-") minusClassOpKey
negateName = methName numClassName FSLIT("negate") negateClassOpKey
plusIntegerName = varQual pREL_NUM FSLIT("plusInteger") plusIntegerIdKey
timesIntegerName = varQual pREL_NUM FSLIT("timesInteger") timesIntegerIdKey
integerTyConName = tcQual pREL_NUM FSLIT("Integer") integerTyConKey
smallIntegerDataConName = conName integerTyConName FSLIT("S#") smallIntegerDataConKey
largeIntegerDataConName = conName integerTyConName FSLIT("J#") largeIntegerDataConKey
-- PrelReal types and classes
rationalTyConName = tcQual pREL_REAL FSLIT("Rational") rationalTyConKey
ratioTyConName = tcQual pREL_REAL FSLIT("Ratio") ratioTyConKey
ratioDataConName = conName ratioTyConName FSLIT(":%") ratioDataConKey
realClassName = clsQual pREL_REAL FSLIT("Real") realClassKey
integralClassName = clsQual pREL_REAL FSLIT("Integral") integralClassKey
realFracClassName = clsQual pREL_REAL FSLIT("RealFrac") realFracClassKey
fractionalClassName = clsQual pREL_REAL FSLIT("Fractional") fractionalClassKey
fromRationalName = methName fractionalClassName FSLIT("fromRational") fromRationalClassOpKey
-- PrelFloat classes
floatingClassName = clsQual pREL_FLOAT FSLIT("Floating") floatingClassKey
realFloatClassName = clsQual pREL_FLOAT FSLIT("RealFloat") realFloatClassKey
-- Class Ix
ixClassName = clsQual pREL_ARR FSLIT("Ix") ixClassKey
-- Class Typeable
typeableClassName = clsQual tYPEABLE FSLIT("Typeable") typeableClassKey
typeable1ClassName = clsQual tYPEABLE FSLIT("Typeable1") typeable1ClassKey
typeable2ClassName = clsQual tYPEABLE FSLIT("Typeable2") typeable2ClassKey
typeable3ClassName = clsQual tYPEABLE FSLIT("Typeable3") typeable3ClassKey
typeable4ClassName = clsQual tYPEABLE FSLIT("Typeable4") typeable4ClassKey
typeable5ClassName = clsQual tYPEABLE FSLIT("Typeable5") typeable5ClassKey
typeable6ClassName = clsQual tYPEABLE FSLIT("Typeable6") typeable6ClassKey
typeable7ClassName = clsQual tYPEABLE FSLIT("Typeable7") typeable7ClassKey
typeableClassNames = [ typeableClassName, typeable1ClassName, typeable2ClassName
, typeable3ClassName, typeable4ClassName, typeable5ClassName
, typeable6ClassName, typeable7ClassName ]
-- Class Data
dataClassName = clsQual gENERICS FSLIT("Data") dataClassKey
-- Error module
assertErrorName = varQual pREL_ERR FSLIT("assertError") assertErrorIdKey
-- Enum module (Enum, Bounded)
enumClassName = clsQual pREL_ENUM FSLIT("Enum") enumClassKey
enumFromName = methName enumClassName FSLIT("enumFrom") enumFromClassOpKey
enumFromToName = methName enumClassName FSLIT("enumFromTo") enumFromToClassOpKey
enumFromThenName = methName enumClassName FSLIT("enumFromThen") enumFromThenClassOpKey
enumFromThenToName = methName enumClassName FSLIT("enumFromThenTo") enumFromThenToClassOpKey
boundedClassName = clsQual pREL_ENUM FSLIT("Bounded") boundedClassKey
-- List functions
concatName = varQual pREL_LIST FSLIT("concat") concatIdKey
filterName = varQual pREL_LIST FSLIT("filter") filterIdKey
zipName = varQual pREL_LIST FSLIT("zip") zipIdKey
-- Class Show
showClassName = clsQual pREL_SHOW FSLIT("Show") showClassKey
-- Class Read
readClassName = clsQual pREL_READ FSLIT("Read") readClassKey
-- parallel array types and functions
enumFromToPName = varQual pREL_PARR FSLIT("enumFromToP") enumFromToPIdKey
enumFromThenToPName= varQual pREL_PARR FSLIT("enumFromThenToP") enumFromThenToPIdKey
nullPName = varQual pREL_PARR FSLIT("nullP") nullPIdKey
lengthPName = varQual pREL_PARR FSLIT("lengthP") lengthPIdKey
replicatePName = varQual pREL_PARR FSLIT("replicateP") replicatePIdKey
mapPName = varQual pREL_PARR FSLIT("mapP") mapPIdKey
filterPName = varQual pREL_PARR FSLIT("filterP") filterPIdKey
zipPName = varQual pREL_PARR FSLIT("zipP") zipPIdKey
crossPName = varQual pREL_PARR FSLIT("crossP") crossPIdKey
indexPName = varQual pREL_PARR FSLIT("!:") indexPIdKey
toPName = varQual pREL_PARR FSLIT("toP") toPIdKey
bpermutePName = varQual pREL_PARR FSLIT("bpermuteP") bpermutePIdKey
bpermuteDftPName = varQual pREL_PARR FSLIT("bpermuteDftP") bpermuteDftPIdKey
indexOfPName = varQual pREL_PARR FSLIT("indexOfP") indexOfPIdKey
-- IOBase things
ioTyConName = tcQual pREL_IO_BASE FSLIT("IO") ioTyConKey
ioDataConName = conName ioTyConName FSLIT("IO") ioDataConKey
thenIOName = varQual pREL_IO_BASE FSLIT("thenIO") thenIOIdKey
bindIOName = varQual pREL_IO_BASE FSLIT("bindIO") bindIOIdKey
returnIOName = varQual pREL_IO_BASE FSLIT("returnIO") returnIOIdKey
failIOName = varQual pREL_IO_BASE FSLIT("failIO") failIOIdKey
-- IO things
printName = varQual sYSTEM_IO FSLIT("print") printIdKey
-- Int, Word, and Addr things
int8TyConName = tcQual pREL_INT FSLIT("Int8") int8TyConKey
int16TyConName = tcQual pREL_INT FSLIT("Int16") int16TyConKey
int32TyConName = tcQual pREL_INT FSLIT("Int32") int32TyConKey
int64TyConName = tcQual pREL_INT FSLIT("Int64") int64TyConKey
-- Word module
word8TyConName = tcQual pREL_WORD FSLIT("Word8") word8TyConKey
word16TyConName = tcQual pREL_WORD FSLIT("Word16") word16TyConKey
word32TyConName = tcQual pREL_WORD FSLIT("Word32") word32TyConKey
word64TyConName = tcQual pREL_WORD FSLIT("Word64") word64TyConKey
wordTyConName = tcQual pREL_WORD FSLIT("Word") wordTyConKey
wordDataConName = conName wordTyConName FSLIT("W#") wordDataConKey
-- Addr module
addrTyConName = tcQual aDDR FSLIT("Addr") addrTyConKey
-- PrelPtr module
ptrTyConName = tcQual pREL_PTR FSLIT("Ptr") ptrTyConKey
funPtrTyConName = tcQual pREL_PTR FSLIT("FunPtr") funPtrTyConKey
-- Byte array types
byteArrayTyConName = tcQual pREL_BYTEARR FSLIT("ByteArray") byteArrayTyConKey
mutableByteArrayTyConName = tcQual pREL_BYTEARR FSLIT("MutableByteArray") mutableByteArrayTyConKey
-- Foreign objects and weak pointers
stablePtrTyConName = tcQual pREL_STABLE FSLIT("StablePtr") stablePtrTyConKey
newStablePtrName = varQual pREL_STABLE FSLIT("newStablePtr") newStablePtrIdKey
-- PrelST module
runSTRepName = varQual pREL_ST FSLIT("runSTRep") runSTRepIdKey
-- The "split" Id for splittable implicit parameters
splittableClassName = clsQual gLA_EXTS FSLIT("Splittable") splittableClassKey
splitName = methName splittableClassName FSLIT("split") splitIdKey
-- Recursive-do notation
monadFixClassName = clsQual mONAD_FIX FSLIT("MonadFix") monadFixClassKey
mfixName = methName monadFixClassName FSLIT("mfix") mfixIdKey
-- Arrow notation
arrAName = varQual aRROW FSLIT("arr") arrAIdKey
composeAName = varQual aRROW FSLIT(">>>") composeAIdKey
firstAName = varQual aRROW FSLIT("first") firstAIdKey
appAName = varQual aRROW FSLIT("app") appAIdKey
choiceAName = varQual aRROW FSLIT("|||") choiceAIdKey
loopAName = varQual aRROW FSLIT("loop") loopAIdKey
-- Other classes, needed for type defaulting
monadPlusClassName = clsQual mONAD FSLIT("MonadPlus") monadPlusClassKey
randomClassName = clsQual rANDOM FSLIT("Random") randomClassKey
randomGenClassName = clsQual rANDOM FSLIT("RandomGen") randomGenClassKey
-- dotnet interop
objectTyConName = tcQual dOTNET FSLIT("Object") objectTyConKey
-- objectTyConName was "wTcQual", but that's gone now, and
-- I can't see why it was wired in anyway...
unmarshalObjectName = varQual dOTNET FSLIT("unmarshalObject") unmarshalObjectIdKey
marshalObjectName = varQual dOTNET FSLIT("marshalObject") marshalObjectIdKey
marshalStringName = varQual dOTNET FSLIT("marshalString") marshalStringIdKey
unmarshalStringName = varQual dOTNET FSLIT("unmarshalString") unmarshalStringIdKey
checkDotnetResName = varQual dOTNET FSLIT("checkResult") checkDotnetResNameIdKey
\end{code}
%************************************************************************
%* *
\subsection{Local helpers}
%* *
%************************************************************************
All these are original names; hence mkOrig
\begin{code}
varQual = mk_known_key_name varName
tcQual = mk_known_key_name tcName
clsQual = mk_known_key_name clsName
mk_known_key_name space mod str uniq
= mkExternalName uniq mod (mkOccNameFS space str)
Nothing noSrcLoc
conName :: Name -> FastString -> Unique -> Name
conName tycon occ uniq
= mkExternalName uniq (nameModule tycon) (mkOccNameFS dataName occ)
(Just tycon) noSrcLoc
methName :: Name -> FastString -> Unique -> Name
methName cls occ uniq
= mkExternalName uniq (nameModule cls) (mkVarOccFS occ)
(Just cls) noSrcLoc
\end{code}
%************************************************************************
%* *
\subsubsection[Uniques-prelude-Classes]{@Uniques@ for wired-in @Classes@}
%* *
%************************************************************************
--MetaHaskell extension hand allocate keys here
\begin{code}
boundedClassKey = mkPreludeClassUnique 1
enumClassKey = mkPreludeClassUnique 2
eqClassKey = mkPreludeClassUnique 3
floatingClassKey = mkPreludeClassUnique 5
fractionalClassKey = mkPreludeClassUnique 6
integralClassKey = mkPreludeClassUnique 7
monadClassKey = mkPreludeClassUnique 8
dataClassKey = mkPreludeClassUnique 9
functorClassKey = mkPreludeClassUnique 10
numClassKey = mkPreludeClassUnique 11
ordClassKey = mkPreludeClassUnique 12
readClassKey = mkPreludeClassUnique 13
realClassKey = mkPreludeClassUnique 14
realFloatClassKey = mkPreludeClassUnique 15
realFracClassKey = mkPreludeClassUnique 16
showClassKey = mkPreludeClassUnique 17
ixClassKey = mkPreludeClassUnique 18
typeableClassKey = mkPreludeClassUnique 20
typeable1ClassKey = mkPreludeClassUnique 21
typeable2ClassKey = mkPreludeClassUnique 22
typeable3ClassKey = mkPreludeClassUnique 23
typeable4ClassKey = mkPreludeClassUnique 24
typeable5ClassKey = mkPreludeClassUnique 25
typeable6ClassKey = mkPreludeClassUnique 26
typeable7ClassKey = mkPreludeClassUnique 27
monadFixClassKey = mkPreludeClassUnique 28
splittableClassKey = mkPreludeClassUnique 29
monadPlusClassKey = mkPreludeClassUnique 30
randomClassKey = mkPreludeClassUnique 31
randomGenClassKey = mkPreludeClassUnique 32
\end{code}
%************************************************************************
%* *
\subsubsection[Uniques-prelude-TyCons]{@Uniques@ for wired-in @TyCons@}
%* *
%************************************************************************
\begin{code}
addrPrimTyConKey = mkPreludeTyConUnique 1
addrTyConKey = mkPreludeTyConUnique 2
arrayPrimTyConKey = mkPreludeTyConUnique 3
boolTyConKey = mkPreludeTyConUnique 4
byteArrayPrimTyConKey = mkPreludeTyConUnique 5
charPrimTyConKey = mkPreludeTyConUnique 7
charTyConKey = mkPreludeTyConUnique 8
doublePrimTyConKey = mkPreludeTyConUnique 9
doubleTyConKey = mkPreludeTyConUnique 10
floatPrimTyConKey = mkPreludeTyConUnique 11
floatTyConKey = mkPreludeTyConUnique 12
funTyConKey = mkPreludeTyConUnique 13
intPrimTyConKey = mkPreludeTyConUnique 14
intTyConKey = mkPreludeTyConUnique 15
int8TyConKey = mkPreludeTyConUnique 16
int16TyConKey = mkPreludeTyConUnique 17
int32PrimTyConKey = mkPreludeTyConUnique 18
int32TyConKey = mkPreludeTyConUnique 19
int64PrimTyConKey = mkPreludeTyConUnique 20
int64TyConKey = mkPreludeTyConUnique 21
integerTyConKey = mkPreludeTyConUnique 22
listTyConKey = mkPreludeTyConUnique 23
foreignObjPrimTyConKey = mkPreludeTyConUnique 24
weakPrimTyConKey = mkPreludeTyConUnique 27
mutableArrayPrimTyConKey = mkPreludeTyConUnique 28
mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 29
orderingTyConKey = mkPreludeTyConUnique 30
mVarPrimTyConKey = mkPreludeTyConUnique 31
ratioTyConKey = mkPreludeTyConUnique 32
rationalTyConKey = mkPreludeTyConUnique 33
realWorldTyConKey = mkPreludeTyConUnique 34
stablePtrPrimTyConKey = mkPreludeTyConUnique 35
stablePtrTyConKey = mkPreludeTyConUnique 36
statePrimTyConKey = mkPreludeTyConUnique 50
stableNamePrimTyConKey = mkPreludeTyConUnique 51
stableNameTyConKey = mkPreludeTyConUnique 52
mutableByteArrayTyConKey = mkPreludeTyConUnique 53
mutVarPrimTyConKey = mkPreludeTyConUnique 55
ioTyConKey = mkPreludeTyConUnique 56
byteArrayTyConKey = mkPreludeTyConUnique 57
wordPrimTyConKey = mkPreludeTyConUnique 58
wordTyConKey = mkPreludeTyConUnique 59
word8TyConKey = mkPreludeTyConUnique 60
word16TyConKey = mkPreludeTyConUnique 61
word32PrimTyConKey = mkPreludeTyConUnique 62
word32TyConKey = mkPreludeTyConUnique 63
word64PrimTyConKey = mkPreludeTyConUnique 64
word64TyConKey = mkPreludeTyConUnique 65
liftedConKey = mkPreludeTyConUnique 66
unliftedConKey = mkPreludeTyConUnique 67
anyBoxConKey = mkPreludeTyConUnique 68
kindConKey = mkPreludeTyConUnique 69
boxityConKey = mkPreludeTyConUnique 70
typeConKey = mkPreludeTyConUnique 71
threadIdPrimTyConKey = mkPreludeTyConUnique 72
bcoPrimTyConKey = mkPreludeTyConUnique 73
ptrTyConKey = mkPreludeTyConUnique 74
funPtrTyConKey = mkPreludeTyConUnique 75
tVarPrimTyConKey = mkPreludeTyConUnique 76
-- Generic Type Constructors
crossTyConKey = mkPreludeTyConUnique 79
plusTyConKey = mkPreludeTyConUnique 80
genUnitTyConKey = mkPreludeTyConUnique 81
-- Parallel array type constructor
parrTyConKey = mkPreludeTyConUnique 82
-- dotnet interop
objectTyConKey = mkPreludeTyConUnique 83
eitherTyConKey = mkPreludeTyConUnique 84
---------------- Template Haskell -------------------
-- USES TyConUniques 100-129
-----------------------------------------------------
unitTyConKey = mkTupleTyConUnique Boxed 0
\end{code}
%************************************************************************
%* *
\subsubsection[Uniques-prelude-DataCons]{@Uniques@ for wired-in @DataCons@}
%* *
%************************************************************************
\begin{code}
charDataConKey = mkPreludeDataConUnique 1
consDataConKey = mkPreludeDataConUnique 2
doubleDataConKey = mkPreludeDataConUnique 3
falseDataConKey = mkPreludeDataConUnique 4
floatDataConKey = mkPreludeDataConUnique 5
intDataConKey = mkPreludeDataConUnique 6
smallIntegerDataConKey = mkPreludeDataConUnique 7
largeIntegerDataConKey = mkPreludeDataConUnique 8
nilDataConKey = mkPreludeDataConUnique 11
ratioDataConKey = mkPreludeDataConUnique 12
stableNameDataConKey = mkPreludeDataConUnique 14
trueDataConKey = mkPreludeDataConUnique 15
wordDataConKey = mkPreludeDataConUnique 16
ioDataConKey = mkPreludeDataConUnique 17
-- Generic data constructors
crossDataConKey = mkPreludeDataConUnique 20
inlDataConKey = mkPreludeDataConUnique 21
inrDataConKey = mkPreludeDataConUnique 22
genUnitDataConKey = mkPreludeDataConUnique 23
-- Data constructor for parallel arrays
parrDataConKey = mkPreludeDataConUnique 24
leftDataConKey = mkPreludeDataConUnique 25
rightDataConKey = mkPreludeDataConUnique 26
\end{code}
%************************************************************************
%* *
\subsubsection[Uniques-prelude-Ids]{@Uniques@ for wired-in @Ids@ (except @DataCons@)}
%* *
%************************************************************************
\begin{code}
absentErrorIdKey = mkPreludeMiscIdUnique 1
augmentIdKey = mkPreludeMiscIdUnique 3
appendIdKey = mkPreludeMiscIdUnique 4
buildIdKey = mkPreludeMiscIdUnique 5
errorIdKey = mkPreludeMiscIdUnique 6
foldlIdKey = mkPreludeMiscIdUnique 7
foldrIdKey = mkPreludeMiscIdUnique 8
recSelErrorIdKey = mkPreludeMiscIdUnique 9
integerMinusOneIdKey = mkPreludeMiscIdUnique 10
integerPlusOneIdKey = mkPreludeMiscIdUnique 11
integerPlusTwoIdKey = mkPreludeMiscIdUnique 12
integerZeroIdKey = mkPreludeMiscIdUnique 13
int2IntegerIdKey = mkPreludeMiscIdUnique 14
seqIdKey = mkPreludeMiscIdUnique 15
irrefutPatErrorIdKey = mkPreludeMiscIdUnique 16
eqStringIdKey = mkPreludeMiscIdUnique 17
noMethodBindingErrorIdKey = mkPreludeMiscIdUnique 18
nonExhaustiveGuardsErrorIdKey = mkPreludeMiscIdUnique 19
runtimeErrorIdKey = mkPreludeMiscIdUnique 20
parErrorIdKey = mkPreludeMiscIdUnique 21
parIdKey = mkPreludeMiscIdUnique 22
patErrorIdKey = mkPreludeMiscIdUnique 23
realWorldPrimIdKey = mkPreludeMiscIdUnique 24
recConErrorIdKey = mkPreludeMiscIdUnique 25
recUpdErrorIdKey = mkPreludeMiscIdUnique 26
traceIdKey = mkPreludeMiscIdUnique 27
unpackCStringUtf8IdKey = mkPreludeMiscIdUnique 28
unpackCStringAppendIdKey = mkPreludeMiscIdUnique 29
unpackCStringFoldrIdKey = mkPreludeMiscIdUnique 30
unpackCStringIdKey = mkPreludeMiscIdUnique 31
unsafeCoerceIdKey = mkPreludeMiscIdUnique 32
concatIdKey = mkPreludeMiscIdUnique 33
filterIdKey = mkPreludeMiscIdUnique 34
zipIdKey = mkPreludeMiscIdUnique 35
bindIOIdKey = mkPreludeMiscIdUnique 36
returnIOIdKey = mkPreludeMiscIdUnique 37
deRefStablePtrIdKey = mkPreludeMiscIdUnique 38
newStablePtrIdKey = mkPreludeMiscIdUnique 39
plusIntegerIdKey = mkPreludeMiscIdUnique 41
timesIntegerIdKey = mkPreludeMiscIdUnique 42
printIdKey = mkPreludeMiscIdUnique 43
failIOIdKey = mkPreludeMiscIdUnique 44
nullAddrIdKey = mkPreludeMiscIdUnique 46
voidArgIdKey = mkPreludeMiscIdUnique 47
splitIdKey = mkPreludeMiscIdUnique 48
fstIdKey = mkPreludeMiscIdUnique 49
sndIdKey = mkPreludeMiscIdUnique 50
otherwiseIdKey = mkPreludeMiscIdUnique 51
assertIdKey = mkPreludeMiscIdUnique 53
runSTRepIdKey = mkPreludeMiscIdUnique 54
rootMainKey = mkPreludeMiscIdUnique 55
runMainKey = mkPreludeMiscIdUnique 56
andIdKey = mkPreludeMiscIdUnique 57
orIdKey = mkPreludeMiscIdUnique 58
thenIOIdKey = mkPreludeMiscIdUnique 59
lazyIdKey = mkPreludeMiscIdUnique 60
assertErrorIdKey = mkPreludeMiscIdUnique 61
breakpointIdKey = mkPreludeMiscIdUnique 62
breakpointJumpIdKey = mkPreludeMiscIdUnique 63
-- Parallel array functions
nullPIdKey = mkPreludeMiscIdUnique 80
lengthPIdKey = mkPreludeMiscIdUnique 81
replicatePIdKey = mkPreludeMiscIdUnique 82
mapPIdKey = mkPreludeMiscIdUnique 83
filterPIdKey = mkPreludeMiscIdUnique 84
zipPIdKey = mkPreludeMiscIdUnique 85
crossPIdKey = mkPreludeMiscIdUnique 86
indexPIdKey = mkPreludeMiscIdUnique 87
toPIdKey = mkPreludeMiscIdUnique 88
enumFromToPIdKey = mkPreludeMiscIdUnique 89
enumFromThenToPIdKey = mkPreludeMiscIdUnique 90
bpermutePIdKey = mkPreludeMiscIdUnique 91
bpermuteDftPIdKey = mkPreludeMiscIdUnique 92
indexOfPIdKey = mkPreludeMiscIdUnique 93
-- dotnet interop
unmarshalObjectIdKey = mkPreludeMiscIdUnique 94
marshalObjectIdKey = mkPreludeMiscIdUnique 95
marshalStringIdKey = mkPreludeMiscIdUnique 96
unmarshalStringIdKey = mkPreludeMiscIdUnique 97
checkDotnetResNameIdKey = mkPreludeMiscIdUnique 98
\end{code}
Certain class operations from Prelude classes. They get their own
uniques so we can look them up easily when we want to conjure them up
during type checking.
\begin{code}
-- Just a place holder for unbound variables produced by the renamer:
unboundKey = mkPreludeMiscIdUnique 101
fromIntegerClassOpKey = mkPreludeMiscIdUnique 102
minusClassOpKey = mkPreludeMiscIdUnique 103
fromRationalClassOpKey = mkPreludeMiscIdUnique 104
enumFromClassOpKey = mkPreludeMiscIdUnique 105
enumFromThenClassOpKey = mkPreludeMiscIdUnique 106
enumFromToClassOpKey = mkPreludeMiscIdUnique 107
enumFromThenToClassOpKey = mkPreludeMiscIdUnique 108
eqClassOpKey = mkPreludeMiscIdUnique 109
geClassOpKey = mkPreludeMiscIdUnique 110
negateClassOpKey = mkPreludeMiscIdUnique 111
failMClassOpKey = mkPreludeMiscIdUnique 112
bindMClassOpKey = mkPreludeMiscIdUnique 113 -- (>>=)
thenMClassOpKey = mkPreludeMiscIdUnique 114 -- (>>)
returnMClassOpKey = mkPreludeMiscIdUnique 117
-- Recursive do notation
mfixIdKey = mkPreludeMiscIdUnique 118
-- Arrow notation
arrAIdKey = mkPreludeMiscIdUnique 119
composeAIdKey = mkPreludeMiscIdUnique 120 -- >>>
firstAIdKey = mkPreludeMiscIdUnique 121
appAIdKey = mkPreludeMiscIdUnique 122
choiceAIdKey = mkPreludeMiscIdUnique 123 -- |||
loopAIdKey = mkPreludeMiscIdUnique 124
---------------- Template Haskell -------------------
-- USES IdUniques 200-399
-----------------------------------------------------
\end{code}
%************************************************************************
%* *
\subsection{Standard groups of types}
%* *
%************************************************************************
\begin{code}
numericTyKeys =
[ addrTyConKey
, wordTyConKey
, intTyConKey
, integerTyConKey
, doubleTyConKey
, floatTyConKey
]
-- Renamer always imports these data decls replete with constructors
-- so that desugarer can always see their constructors. Ugh!
cCallishTyKeys =
[ addrTyConKey
, wordTyConKey
, byteArrayTyConKey
, mutableByteArrayTyConKey
, stablePtrTyConKey
, int8TyConKey
, int16TyConKey
, int32TyConKey
, int64TyConKey
, word8TyConKey
, word16TyConKey
, word32TyConKey
, word64TyConKey
]
\end{code}
%************************************************************************
%* *
\subsection[Class-std-groups]{Standard groups of Prelude classes}
%* *
%************************************************************************
NOTE: @Eq@ and @Text@ do need to appear in @standardClasses@
even though every numeric class has these two as a superclass,
because the list of ambiguous dictionaries hasn't been simplified.
\begin{code}
numericClassKeys =
[ numClassKey
, realClassKey
, integralClassKey
]
++ fractionalClassKeys
fractionalClassKeys =
[ fractionalClassKey
, floatingClassKey
, realFracClassKey
, realFloatClassKey
]
-- the strictness analyser needs to know about numeric types
-- (see SaAbsInt.lhs)
needsDataDeclCtxtClassKeys = -- see comments in TcDeriv
[ readClassKey
]
-- The "standard classes" are used in defaulting (Haskell 98 report 4.3.4),
-- and are: "classes defined in the Prelude or a standard library"
standardClassKeys = derivableClassKeys ++ numericClassKeys
++ [randomClassKey, randomGenClassKey,
functorClassKey,
monadClassKey, monadPlusClassKey]
\end{code}
@derivableClassKeys@ is also used in checking \tr{deriving} constructs
(@TcDeriv@).
\begin{code}
derivableClassKeys
= [ eqClassKey, ordClassKey, enumClassKey, ixClassKey,
boundedClassKey, showClassKey, readClassKey ]
\end{code}
|