436b121adcf2862129cd4d86814f92d3710462d4
[ghc-hetmet.git] / compiler / prelude / TysWiredIn.lhs
1 %
2 % (c) The GRASP Project, Glasgow University, 1994-1998
3 %
4 \section[TysWiredIn]{Wired-in knowledge about {\em non-primitive} types}
5
6 This module is about types that can be defined in Haskell, but which
7 must be wired into the compiler nonetheless.
8
9 This module tracks the ``state interface'' document, ``GHC prelude:
10 types and operations.''
11
12 \begin{code}
13 module TysWiredIn (
14         wiredInTyCons, 
15
16         boolTy, boolTyCon, boolTyCon_RDR, boolTyConName,
17         trueDataCon,  trueDataConId,  true_RDR,
18         falseDataCon, falseDataConId, false_RDR,
19
20         charTyCon, charDataCon, charTyCon_RDR,
21         charTy, stringTy, charTyConName,
22
23         
24         doubleTyCon, doubleDataCon, doubleTy, doubleTyConName, 
25         
26         floatTyCon, floatDataCon, floatTy, floatTyConName,
27
28         intTyCon, intDataCon, intTyCon_RDR, intDataCon_RDR, intTyConName,
29         intTy,
30
31         listTyCon, nilDataCon, consDataCon,
32         listTyCon_RDR, consDataCon_RDR, listTyConName,
33         mkListTy,
34
35         -- tuples
36         mkTupleTy,
37         tupleTyCon, tupleCon, 
38         unitTyCon, unitDataCon, unitDataConId, pairTyCon, 
39         unboxedSingletonTyCon, unboxedSingletonDataCon,
40         unboxedPairTyCon, unboxedPairDataCon,
41
42         unitTy,
43         voidTy,
44
45         -- parallel arrays
46         mkPArrTy,
47         parrTyCon, parrFakeCon, isPArrTyCon, isPArrFakeCon,
48         parrTyCon_RDR, parrTyConName
49     ) where
50
51 #include "HsVersions.h"
52
53 import {-# SOURCE #-} MkId( mkDataConIds )
54
55 -- friends:
56 import PrelNames
57 import TysPrim
58
59 -- others:
60 import Constants        ( mAX_TUPLE_SIZE )
61 import Module           ( Module )
62 import RdrName          ( nameRdrName )
63 import Name             ( Name, BuiltInSyntax(..), nameUnique, nameOccName, 
64                           nameModule, mkWiredInName )
65 import OccName          ( mkOccNameFS, tcName, dataName, mkTupleOcc,
66                           mkDataConWorkerOcc )
67 import DataCon          ( DataCon, mkDataCon, dataConWorkId, dataConSourceArity )
68 import Var              ( TyVar, tyVarKind )
69 import TyCon            ( TyCon, AlgTyConRhs(DataTyCon), tyConDataCons,
70                           mkTupleTyCon, mkAlgTyCon, tyConName,
71                           AlgTyConParent(NoParentTyCon) )
72
73 import BasicTypes       ( Arity, RecFlag(..), Boxity(..), isBoxed,
74                           StrictnessMark(..) )
75
76 import Type             ( Type, mkTyConTy, mkTyConApp, mkTyVarTy, mkTyVarTys,
77                           TyThing(..) )
78 import Coercion         ( unsafeCoercionTyCon, symCoercionTyCon,
79                           transCoercionTyCon, leftCoercionTyCon, 
80                           rightCoercionTyCon, instCoercionTyCon )
81 import TypeRep          ( mkArrowKinds, liftedTypeKind, ubxTupleKind )
82 import Unique           ( incrUnique, mkTupleTyConUnique,
83                           mkTupleDataConUnique, mkPArrDataConUnique )
84 import Array
85 import FastString
86 import Outputable
87
88 alpha_tyvar = [alphaTyVar]
89 alpha_ty    = [alphaTy]
90 \end{code}
91
92
93 %************************************************************************
94 %*                                                                      *
95 \subsection{Wired in type constructors}
96 %*                                                                      *
97 %************************************************************************
98
99 If you change which things are wired in, make sure you change their
100 names in PrelNames, so they use wTcQual, wDataQual, etc
101
102 \begin{code}
103 wiredInTyCons :: [TyCon]        -- Excludes tuples
104 -- This list is used only to define PrelInfo.wiredInThings
105
106 -- It does not need to include kind constructors, because
107 -- all that wiredInThings does is to initialise the Name table,
108 -- and kind constructors don't appear in source code.
109
110 wiredInTyCons = [ unitTyCon     -- Not treated like other tuples, because
111                                 -- it's defined in GHC.Base, and there's only
112                                 -- one of it.  We put it in wiredInTyCons so
113                                 -- that it'll pre-populate the name cache, so
114                                 -- the special case in lookupOrigNameCache 
115                                 -- doesn't need to look out for it
116               , boolTyCon
117               , charTyCon
118               , doubleTyCon
119               , floatTyCon
120               , intTyCon
121               , listTyCon
122               , parrTyCon
123               , unsafeCoercionTyCon
124               , symCoercionTyCon
125               , transCoercionTyCon
126               , leftCoercionTyCon
127               , rightCoercionTyCon
128               , instCoercionTyCon
129               ]
130 \end{code}
131
132 \begin{code}
133 mkWiredInTyConName :: BuiltInSyntax -> Module -> FastString -> Unique -> TyCon -> Name
134 mkWiredInTyConName built_in mod fs uniq tycon
135   = mkWiredInName mod (mkOccNameFS tcName fs) uniq
136                   (ATyCon tycon)        -- Relevant TyCon
137                   built_in
138
139 mkWiredInDataConName :: BuiltInSyntax -> Module -> FastString -> Unique -> DataCon -> Name
140 mkWiredInDataConName built_in mod fs uniq datacon
141   = mkWiredInName mod (mkOccNameFS dataName fs) uniq
142                   (ADataCon datacon)    -- Relevant DataCon
143                   built_in
144
145 charTyConName     = mkWiredInTyConName   UserSyntax gHC_BASE FSLIT("Char") charTyConKey charTyCon
146 charDataConName   = mkWiredInDataConName UserSyntax gHC_BASE FSLIT("C#") charDataConKey charDataCon
147 intTyConName      = mkWiredInTyConName   UserSyntax gHC_BASE FSLIT("Int") intTyConKey   intTyCon
148 intDataConName    = mkWiredInDataConName UserSyntax gHC_BASE FSLIT("I#") intDataConKey  intDataCon
149                                                   
150 boolTyConName     = mkWiredInTyConName   UserSyntax gHC_BASE FSLIT("Bool") boolTyConKey boolTyCon
151 falseDataConName  = mkWiredInDataConName UserSyntax gHC_BASE FSLIT("False") falseDataConKey falseDataCon
152 trueDataConName   = mkWiredInDataConName UserSyntax gHC_BASE FSLIT("True")  trueDataConKey  trueDataCon 
153 listTyConName     = mkWiredInTyConName   BuiltInSyntax gHC_BASE FSLIT("[]") listTyConKey listTyCon
154 nilDataConName    = mkWiredInDataConName BuiltInSyntax gHC_BASE FSLIT("[]") nilDataConKey nilDataCon 
155 consDataConName   = mkWiredInDataConName BuiltInSyntax gHC_BASE FSLIT(":") consDataConKey consDataCon
156
157 floatTyConName     = mkWiredInTyConName   UserSyntax gHC_FLOAT FSLIT("Float") floatTyConKey floatTyCon
158 floatDataConName   = mkWiredInDataConName UserSyntax gHC_FLOAT FSLIT("F#") floatDataConKey floatDataCon
159 doubleTyConName    = mkWiredInTyConName   UserSyntax gHC_FLOAT FSLIT("Double") doubleTyConKey doubleTyCon
160 doubleDataConName  = mkWiredInDataConName UserSyntax gHC_FLOAT FSLIT("D#") doubleDataConKey doubleDataCon
161
162 parrTyConName     = mkWiredInTyConName   BuiltInSyntax gHC_PARR FSLIT("[::]") parrTyConKey parrTyCon 
163 parrDataConName   = mkWiredInDataConName UserSyntax    gHC_PARR FSLIT("PArr") parrDataConKey parrDataCon
164
165 boolTyCon_RDR   = nameRdrName boolTyConName
166 false_RDR       = nameRdrName falseDataConName
167 true_RDR        = nameRdrName trueDataConName
168 intTyCon_RDR    = nameRdrName intTyConName
169 charTyCon_RDR   = nameRdrName charTyConName
170 intDataCon_RDR  = nameRdrName intDataConName
171 listTyCon_RDR   = nameRdrName listTyConName
172 consDataCon_RDR = nameRdrName consDataConName
173 parrTyCon_RDR   = nameRdrName parrTyConName
174 {-
175 tySuperKindTyCon_RDR     = nameRdrName tySuperKindTyConName
176 coSuperKindTyCon_RDR = nameRdrName coSuperKindTyConName
177 liftedTypeKindTyCon_RDR   = nameRdrName liftedTypeKindTyConName
178 openTypeKindTyCon_RDR     = nameRdrName openTypeKindTyConName
179 unliftedTypeKindTyCon_RDR = nameRdrName unliftedTypeKindTyConName
180 ubxTupleKindTyCon_RDR     = nameRdrName ubxTupleKindTyConName
181 argTypeKindTyCon_RDR      = nameRdrName argTypeKindTyConName
182 funKindTyCon_RDR          = nameRdrName funKindTyConName
183 -}
184 \end{code}
185
186
187 %************************************************************************
188 %*                                                                      *
189 \subsection{mkWiredInTyCon}
190 %*                                                                      *
191 %************************************************************************
192
193 \begin{code}
194 pcNonRecDataTyCon = pcTyCon False NonRecursive
195 pcRecDataTyCon    = pcTyCon False Recursive
196
197 pcTyCon is_enum is_rec name tyvars cons
198   = tycon
199   where
200     tycon = mkAlgTyCon name
201                 (mkArrowKinds (map tyVarKind tyvars) liftedTypeKind)
202                 tyvars
203                 []              -- No stupid theta
204                 (DataTyCon cons is_enum)
205                 []              -- No record selectors
206                 NoParentTyCon
207                 is_rec
208                 True            -- All the wired-in tycons have generics
209                 False           -- Not in GADT syntax
210
211 pcDataCon :: Name -> [TyVar] -> [Type] -> TyCon -> DataCon
212 pcDataCon = pcDataConWithFixity False
213
214 pcDataConWithFixity :: Bool -> Name -> [TyVar] -> [Type] -> TyCon -> DataCon
215 -- The Name should be in the DataName name space; it's the name
216 -- of the DataCon itself.
217 --
218 -- The unique is the first of two free uniques;
219 -- the first is used for the datacon itself,
220 -- the second is used for the "worker name"
221
222 pcDataConWithFixity declared_infix dc_name tyvars arg_tys tycon
223   = data_con
224   where
225     data_con = mkDataCon dc_name declared_infix
226                 (map (const NotMarkedStrict) arg_tys)
227                 []      -- No labelled fields
228                 tyvars
229                 []      -- No existential type variables
230                 []      -- No equality spec
231                 []      -- No theta
232                 arg_tys tycon
233                 []      -- No stupid theta
234                 (mkDataConIds bogus_wrap_name wrk_name data_con)
235                 
236
237     mod      = nameModule dc_name
238     wrk_occ  = mkDataConWorkerOcc (nameOccName dc_name)
239     wrk_key  = incrUnique (nameUnique dc_name)
240     wrk_name = mkWiredInName mod wrk_occ wrk_key
241                              (AnId (dataConWorkId data_con)) UserSyntax
242     bogus_wrap_name = pprPanic "Wired-in data wrapper id" (ppr dc_name)
243         -- Wired-in types are too simple to need wrappers
244 \end{code}
245
246
247 %************************************************************************
248 %*                                                                      *
249 \subsection[TysWiredIn-tuples]{The tuple types}
250 %*                                                                      *
251 %************************************************************************
252
253 \begin{code}
254 tupleTyCon :: Boxity -> Arity -> TyCon
255 tupleTyCon boxity i | i > mAX_TUPLE_SIZE = fst (mk_tuple boxity i)      -- Build one specially
256 tupleTyCon Boxed   i = fst (boxedTupleArr   ! i)
257 tupleTyCon Unboxed i = fst (unboxedTupleArr ! i)
258
259 tupleCon :: Boxity -> Arity -> DataCon
260 tupleCon boxity i | i > mAX_TUPLE_SIZE = snd (mk_tuple boxity i)        -- Build one specially
261 tupleCon Boxed   i = snd (boxedTupleArr   ! i)
262 tupleCon Unboxed i = snd (unboxedTupleArr ! i)
263
264 boxedTupleArr, unboxedTupleArr :: Array Int (TyCon,DataCon)
265 boxedTupleArr   = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Boxed i | i <- [0..mAX_TUPLE_SIZE]]
266 unboxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Unboxed i | i <- [0..mAX_TUPLE_SIZE]]
267
268 mk_tuple :: Boxity -> Int -> (TyCon,DataCon)
269 mk_tuple boxity arity = (tycon, tuple_con)
270   where
271         tycon   = mkTupleTyCon tc_name tc_kind arity tyvars tuple_con boxity gen_info 
272         mod     = mkTupleModule boxity arity
273         tc_name = mkWiredInName mod (mkTupleOcc tcName boxity arity) tc_uniq
274                                 (ATyCon tycon) BuiltInSyntax
275         tc_kind = mkArrowKinds (map tyVarKind tyvars) res_kind
276         res_kind | isBoxed boxity = liftedTypeKind
277                  | otherwise      = ubxTupleKind
278
279         tyvars   | isBoxed boxity = take arity alphaTyVars
280                  | otherwise      = take arity openAlphaTyVars
281
282         tuple_con = pcDataCon dc_name tyvars tyvar_tys tycon
283         tyvar_tys = mkTyVarTys tyvars
284         dc_name   = mkWiredInName mod (mkTupleOcc dataName boxity arity) dc_uniq
285                                   (ADataCon tuple_con) BuiltInSyntax
286         tc_uniq   = mkTupleTyConUnique   boxity arity
287         dc_uniq   = mkTupleDataConUnique boxity arity
288         gen_info  = True                -- Tuples all have generics..
289                                         -- hmm: that's a *lot* of code
290
291 unitTyCon     = tupleTyCon Boxed 0
292 unitDataCon   = head (tyConDataCons unitTyCon)
293 unitDataConId = dataConWorkId unitDataCon
294
295 pairTyCon = tupleTyCon Boxed 2
296
297 unboxedSingletonTyCon   = tupleTyCon Unboxed 1
298 unboxedSingletonDataCon = tupleCon   Unboxed 1
299
300 unboxedPairTyCon   = tupleTyCon Unboxed 2
301 unboxedPairDataCon = tupleCon   Unboxed 2
302 \end{code}
303
304 %************************************************************************
305 %*                                                                      *
306 \subsection[TysWiredIn-boxed-prim]{The ``boxed primitive'' types (@Char@, @Int@, etc)}
307 %*                                                                      *
308 %************************************************************************
309
310 \begin{code}
311 -- The Void type is represented as a data type with no constructors
312 -- It's a built in type (i.e. there's no way to define it in Haskell;
313 --      the nearest would be
314 --
315 --              data Void =             -- No constructors!
316 --
317 -- ) It's lifted; there is only one value of this
318 -- type, namely "void", whose semantics is just bottom.
319 --
320 -- Haskell 98 drops the definition of a Void type, so we just 'simulate'
321 -- voidTy using ().
322 voidTy = unitTy
323 \end{code}
324
325
326 \begin{code}
327 charTy = mkTyConTy charTyCon
328
329 charTyCon   = pcNonRecDataTyCon charTyConName [] [charDataCon]
330 charDataCon = pcDataCon charDataConName [] [charPrimTy] charTyCon
331
332 stringTy = mkListTy charTy -- convenience only
333 \end{code}
334
335 \begin{code}
336 intTy = mkTyConTy intTyCon 
337
338 intTyCon = pcNonRecDataTyCon intTyConName [] [intDataCon]
339 intDataCon = pcDataCon intDataConName [] [intPrimTy] intTyCon
340 \end{code}
341
342 \begin{code}
343 floatTy = mkTyConTy floatTyCon
344
345 floatTyCon   = pcNonRecDataTyCon floatTyConName   [] [floatDataCon]
346 floatDataCon = pcDataCon         floatDataConName [] [floatPrimTy] floatTyCon
347 \end{code}
348
349 \begin{code}
350 doubleTy = mkTyConTy doubleTyCon
351
352 doubleTyCon   = pcNonRecDataTyCon doubleTyConName   [] [doubleDataCon]
353 doubleDataCon = pcDataCon         doubleDataConName [] [doublePrimTy] doubleTyCon
354 \end{code}
355
356
357 %************************************************************************
358 %*                                                                      *
359 \subsection[TysWiredIn-Bool]{The @Bool@ type}
360 %*                                                                      *
361 %************************************************************************
362
363 An ordinary enumeration type, but deeply wired in.  There are no
364 magical operations on @Bool@ (just the regular Prelude code).
365
366 {\em BEGIN IDLE SPECULATION BY SIMON}
367
368 This is not the only way to encode @Bool@.  A more obvious coding makes
369 @Bool@ just a boxed up version of @Bool#@, like this:
370 \begin{verbatim}
371 type Bool# = Int#
372 data Bool = MkBool Bool#
373 \end{verbatim}
374
375 Unfortunately, this doesn't correspond to what the Report says @Bool@
376 looks like!  Furthermore, we get slightly less efficient code (I
377 think) with this coding. @gtInt@ would look like this:
378
379 \begin{verbatim}
380 gtInt :: Int -> Int -> Bool
381 gtInt x y = case x of I# x# ->
382             case y of I# y# ->
383             case (gtIntPrim x# y#) of
384                 b# -> MkBool b#
385 \end{verbatim}
386
387 Notice that the result of the @gtIntPrim@ comparison has to be turned
388 into an integer (here called @b#@), and returned in a @MkBool@ box.
389
390 The @if@ expression would compile to this:
391 \begin{verbatim}
392 case (gtInt x y) of
393   MkBool b# -> case b# of { 1# -> e1; 0# -> e2 }
394 \end{verbatim}
395
396 I think this code is a little less efficient than the previous code,
397 but I'm not certain.  At all events, corresponding with the Report is
398 important.  The interesting thing is that the language is expressive
399 enough to describe more than one alternative; and that a type doesn't
400 necessarily need to be a straightforwardly boxed version of its
401 primitive counterpart.
402
403 {\em END IDLE SPECULATION BY SIMON}
404
405 \begin{code}
406 boolTy = mkTyConTy boolTyCon
407
408 boolTyCon = pcTyCon True NonRecursive boolTyConName
409                     [] [falseDataCon, trueDataCon]
410
411 falseDataCon = pcDataCon falseDataConName [] [] boolTyCon
412 trueDataCon  = pcDataCon trueDataConName  [] [] boolTyCon
413
414 falseDataConId = dataConWorkId falseDataCon
415 trueDataConId  = dataConWorkId trueDataCon
416 \end{code}
417
418 %************************************************************************
419 %*                                                                      *
420 \subsection[TysWiredIn-List]{The @List@ type (incl ``build'' magic)}
421 %*                                                                      *
422 %************************************************************************
423
424 Special syntax, deeply wired in, but otherwise an ordinary algebraic
425 data types:
426 \begin{verbatim}
427 data [] a = [] | a : (List a)
428 data () = ()
429 data (,) a b = (,,) a b
430 ...
431 \end{verbatim}
432
433 \begin{code}
434 mkListTy :: Type -> Type
435 mkListTy ty = mkTyConApp listTyCon [ty]
436
437 listTyCon = pcRecDataTyCon listTyConName alpha_tyvar [nilDataCon, consDataCon]
438
439 nilDataCon  = pcDataCon nilDataConName alpha_tyvar [] listTyCon
440 consDataCon = pcDataConWithFixity True {- Declared infix -}
441                consDataConName
442                alpha_tyvar [alphaTy, mkTyConApp listTyCon alpha_ty] listTyCon
443 -- Interesting: polymorphic recursion would help here.
444 -- We can't use (mkListTy alphaTy) in the defn of consDataCon, else mkListTy
445 -- gets the over-specific type (Type -> Type)
446 \end{code}
447
448 %************************************************************************
449 %*                                                                      *
450 \subsection[TysWiredIn-Tuples]{The @Tuple@ types}
451 %*                                                                      *
452 %************************************************************************
453
454 The tuple types are definitely magic, because they form an infinite
455 family.
456
457 \begin{itemize}
458 \item
459 They have a special family of type constructors, of type @TyCon@
460 These contain the tycon arity, but don't require a Unique.
461
462 \item
463 They have a special family of constructors, of type
464 @Id@. Again these contain their arity but don't need a Unique.
465
466 \item
467 There should be a magic way of generating the info tables and
468 entry code for all tuples.
469
470 But at the moment we just compile a Haskell source
471 file\srcloc{lib/prelude/...} containing declarations like:
472 \begin{verbatim}
473 data Tuple0             = Tup0
474 data Tuple2  a b        = Tup2  a b
475 data Tuple3  a b c      = Tup3  a b c
476 data Tuple4  a b c d    = Tup4  a b c d
477 ...
478 \end{verbatim}
479 The print-names associated with the magic @Id@s for tuple constructors
480 ``just happen'' to be the same as those generated by these
481 declarations.
482
483 \item
484 The instance environment should have a magic way to know
485 that each tuple type is an instances of classes @Eq@, @Ix@, @Ord@ and
486 so on. \ToDo{Not implemented yet.}
487
488 \item
489 There should also be a way to generate the appropriate code for each
490 of these instances, but (like the info tables and entry code) it is
491 done by enumeration\srcloc{lib/prelude/InTup?.hs}.
492 \end{itemize}
493
494 \begin{code}
495 mkTupleTy :: Boxity -> Int -> [Type] -> Type
496 mkTupleTy boxity arity tys = mkTyConApp (tupleTyCon boxity arity) tys
497
498 unitTy    = mkTupleTy Boxed 0 []
499 \end{code}
500
501 %************************************************************************
502 %*                                                                      *
503 \subsection[TysWiredIn-PArr]{The @[::]@ type}
504 %*                                                                      *
505 %************************************************************************
506
507 Special syntax for parallel arrays needs some wired in definitions.
508
509 \begin{code}
510 -- construct a type representing the application of the parallel array
511 -- constructor 
512 --
513 mkPArrTy    :: Type -> Type
514 mkPArrTy ty  = mkTyConApp parrTyCon [ty]
515
516 -- represents the type constructor of parallel arrays
517 --
518 --  * this must match the definition in `PrelPArr'
519 --
520 -- NB: Although the constructor is given here, it will not be accessible in
521 --     user code as it is not in the environment of any compiled module except
522 --     `PrelPArr'.
523 --
524 parrTyCon :: TyCon
525 parrTyCon  = pcNonRecDataTyCon parrTyConName alpha_tyvar [parrDataCon]
526
527 parrDataCon :: DataCon
528 parrDataCon  = pcDataCon 
529                  parrDataConName 
530                  alpha_tyvar            -- forall'ed type variables
531                  [intPrimTy,            -- 1st argument: Int#
532                   mkTyConApp            -- 2nd argument: Array# a
533                     arrayPrimTyCon 
534                     alpha_ty] 
535                  parrTyCon
536
537 -- check whether a type constructor is the constructor for parallel arrays
538 --
539 isPArrTyCon    :: TyCon -> Bool
540 isPArrTyCon tc  = tyConName tc == parrTyConName
541
542 -- fake array constructors
543 --
544 --  * these constructors are never really used to represent array values;
545 --   however, they are very convenient during desugaring (and, in particular,
546 --   in the pattern matching compiler) to treat array pattern just like
547 --   yet another constructor pattern
548 --
549 parrFakeCon                        :: Arity -> DataCon
550 parrFakeCon i | i > mAX_TUPLE_SIZE  = mkPArrFakeCon  i  -- build one specially
551 parrFakeCon i                       = parrFakeConArr!i
552
553 -- pre-defined set of constructors
554 --
555 parrFakeConArr :: Array Int DataCon
556 parrFakeConArr  = array (0, mAX_TUPLE_SIZE) [(i, mkPArrFakeCon i)   
557                                             | i <- [0..mAX_TUPLE_SIZE]]
558
559 -- build a fake parallel array constructor for the given arity
560 --
561 mkPArrFakeCon       :: Int -> DataCon
562 mkPArrFakeCon arity  = data_con
563   where
564         data_con  = pcDataCon name [tyvar] tyvarTys parrTyCon
565         tyvar     = head alphaTyVars
566         tyvarTys  = replicate arity $ mkTyVarTy tyvar
567         nameStr   = mkFastString ("MkPArr" ++ show arity)
568         name      = mkWiredInName gHC_PARR (mkOccNameFS dataName nameStr) uniq
569                                   (ADataCon data_con) UserSyntax
570         uniq      = mkPArrDataConUnique arity
571
572 -- checks whether a data constructor is a fake constructor for parallel arrays
573 --
574 isPArrFakeCon      :: DataCon -> Bool
575 isPArrFakeCon dcon  = dcon == parrFakeCon (dataConSourceArity dcon)
576 \end{code}
577
578