2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
4 \section[TyCon]{The @TyCon@ datatype}
13 AlgTyConRhs(..), visibleDataCons,
15 isFunTyCon, isUnLiftedTyCon, isProductTyCon,
16 isAlgTyCon, isDataTyCon, isSynTyCon, isNewTyCon, isPrimTyCon,
17 isEnumerationTyCon, isGadtSyntaxTyCon,
18 isTupleTyCon, isUnboxedTupleTyCon, isBoxedTupleTyCon, tupleTyConBoxity,
19 isRecursiveTyCon, newTyConRep, newTyConRhs, newTyConCo,
20 isHiBootTyCon, isSuperKindTyCon,
21 isCoercionTyCon_maybe, isCoercionTyCon,
23 tcExpandTyCon_maybe, coreExpandTyCon_maybe,
25 makeTyConAbstract, isAbstractTyCon,
27 mkForeignTyCon, isForeignTyCon,
44 algTyConRhs, tyConDataCons, tyConDataCons_maybe, tyConFamilySize,
48 isClassTyCon, tyConClass_maybe,
49 synTyConDefn, synTyConRhs,
50 tyConExtName, -- External name for foreign types
58 #include "HsVersions.h"
60 import {-# SOURCE #-} TypeRep ( Kind, Type, Coercion, PredType )
61 import {-# SOURCE #-} DataCon ( DataCon, isVanillaDataCon )
63 import Var ( TyVar, Id )
64 import Class ( Class )
65 import BasicTypes ( Arity, RecFlag(..), Boxity(..), isBoxed )
66 import Name ( Name, nameUnique, NamedThing(getName) )
67 import PrelNames ( Unique, Uniquable(..) )
68 import Maybes ( orElse )
73 %************************************************************************
75 \subsection{The data type}
77 %************************************************************************
82 tyConUnique :: Unique,
89 | AlgTyCon { -- Data type, and newtype decls.
90 -- All lifted, all boxed
91 tyConUnique :: Unique,
96 tyConTyVars :: [TyVar], -- Scopes over (a) the [PredType] in AlgTyConRhs.DataTyCon
97 -- (b) the cached types in AlgTyConRhs.NewTyCon
98 -- But not over the data constructors
99 algTcSelIds :: [Id], -- Its record selectors (empty if none):
101 algTcGadtSyntax :: Bool, -- True <=> the data type was declared using GADT syntax
102 -- That doesn't mean it's a true GADT; only that the "where"
103 -- form was used. This field is used only to guide
105 algTcStupidTheta :: [PredType], -- The "stupid theta" for the data type
106 -- (always empty for GADTs)
108 algTcRhs :: AlgTyConRhs, -- Data constructors in here
110 algTcRec :: RecFlag, -- Tells whether the data type is part of
111 -- a mutually-recursive group or not
113 hasGenerics :: Bool, -- True <=> generic to/from functions are available
114 -- (in the exports of the data type's source module)
116 algTcClass :: Maybe Class
117 -- Just cl if this tycon came from a class declaration
121 tyConUnique :: Unique,
125 tyConBoxed :: Boxity,
126 tyConTyVars :: [TyVar],
132 tyConUnique :: Unique,
137 tyConTyVars :: [TyVar], -- Bound tyvars
138 synTcRhs :: Type -- Right-hand side, mentioning these type vars.
139 -- Acts as a template for the expansion when
140 -- the tycon is applied to some types.
143 | PrimTyCon { -- Primitive types; cannot be defined in Haskell
144 -- Now includes foreign-imported types
145 -- Also includes Kinds
146 tyConUnique :: Unique,
151 primTyConRep :: PrimRep,
152 -- Many primitive tycons are unboxed, but some are
153 -- boxed (represented by pointers). The CgRep tells.
155 isUnLifted :: Bool, -- Most primitive tycons are unlifted,
156 -- but foreign-imported ones may not be
157 tyConExtName :: Maybe FastString -- Just xx for foreign-imported types
160 | CoercionTyCon { -- E.g. (:=:), sym, trans, left, right
161 -- INVARIANT: coercions are always fully applied
162 tyConUnique :: Unique,
165 coKindFun :: [Type] -> Kind
168 | SuperKindTyCon { -- Super Kinds, TY (box) and CO (diamond).
169 -- They have no kind; and arity zero
170 tyConUnique :: Unique,
176 type SuperKindCon = TyCon
178 type FieldLabel = Name
181 = AbstractTyCon -- We know nothing about this data type, except
182 -- that it's represented by a pointer
183 -- Used when we export a data type abstractly into
187 data_cons :: [DataCon],
188 -- The constructors; can be empty if the user declares
189 -- the type to have no constructors
190 -- INVARIANT: Kept in order of increasing tag
191 -- (see the tag assignment in DataCon.mkDataCon)
192 is_enum :: Bool -- Cached: True <=> an enumeration type
193 } -- Includes data types with no constructors.
196 data_con :: DataCon, -- The unique constructor; it has no existentials
198 nt_rhs :: Type, -- Cached: the argument type of the constructor
199 -- = the representation type of the tycon
200 -- The free tyvars of this type are the tyConTyVars
202 nt_co :: Maybe TyCon, -- The coercion used to create the newtype
203 -- from the representation
204 -- optional for non-recursive newtypes
205 -- See Note [Newtype coercions]
207 nt_etad_rhs :: ([TyVar], Type) ,
208 -- The same again, but this time eta-reduced
209 -- hence the [TyVar] which may be shorter than the declared
210 -- arity of the TyCon. See Note [Newtype eta]
212 nt_rep :: Type -- Cached: the *ultimate* representation type
213 -- By 'ultimate' I mean that the top-level constructor
214 -- of the rep type is not itself a newtype or type synonym.
215 -- The rep type isn't entirely simple:
216 -- for a recursive newtype we pick () as the rep type
219 -- This one does not need to be eta reduced; hence its
220 -- free type variables are conveniently tyConTyVars
222 -- newtype T a = MkT [(a,Int)]
223 -- The rep type is [(a,Int)]
224 -- NB: the rep type isn't necessarily the original RHS of the
225 -- newtype decl, because the rep type looks through other
228 visibleDataCons :: AlgTyConRhs -> [DataCon]
229 visibleDataCons AbstractTyCon = []
230 visibleDataCons (DataTyCon{ data_cons = cs }) = cs
231 visibleDataCons (NewTyCon{ data_con = c }) = [c]
234 Note [Newtype coercions]
235 ~~~~~~~~~~~~~~~~~~~~~~~~
237 The NewTyCon field nt_co is a a TyCon (a coercion constructor in fact)
238 which is used for coercing from the representation type of the
239 newtype, to the newtype itself. For example,
241 newtype T a = MkT [a]
243 the NewTyCon for T will contain nt_co = CoT where CoT t : [t] :=: T t.
244 This TyCon is a CoercionTyCon, so it does not have a kind on its own;
245 it basically has its own typing rule for the fully-applied version.
246 If the newtype T has k type variables then CoT has arity k.
248 In the paper we'd write
249 axiom CoT : (forall t. [t]) :=: (forall t. T t)
250 and then when we used CoT at a particular type, s, we'd say
252 which encodes as (TyConApp instCoercionTyCon [TyConApp CoT [], s])
254 But in GHC we instead make CoT into a new piece of type syntax
255 (like instCoercionTyCon, symCoercionTyCon etc), which must always
256 be saturated, but which encodes as
258 In the vocabulary of the paper it's as if we had axiom declarations
260 axiom CoT t : ([t] :=: T t)
265 newtype Parser m a = MkParser (Foogle m a)
266 Are these two types equal (to Core)?
269 Well, yes. But to see that easily we eta-reduce the RHS type of
270 Parser, in this case to ([], Froogle), so that even unsaturated applications
271 of Parser will work right. This eta reduction is done when the type
272 constructor is built, and cached in NewTyCon. The cached field is
273 only used in coreExpandTyCon_maybe.
275 Here's an example that I think showed up in practice
277 newtype T a = MkT [a]
278 newtype Foo m = MkFoo (forall a. m a -> Int)
284 w2 = MkFoo (\(MkT x) -> case w1 of MkFoo f -> f x)
286 After desugaring, and discading the data constructors for the newtypes,
290 And now Lint complains unless Foo T == Foo [], and that requires T==[]
293 %************************************************************************
297 %************************************************************************
299 A PrimRep is an abstraction of a type. It contains information that
300 the code generator needs in order to pass arguments, return results,
301 and store values of this type.
303 A PrimRep is somewhat similar to a CgRep (see codeGen/SMRep) and a
304 MachRep (see cmm/MachOp), although each of these types has a distinct
305 and clearly defined purpose:
307 - A PrimRep is a CgRep + information about signedness + information
308 about primitive pointers (AddrRep). Signedness and primitive
309 pointers are required when passing a primitive type to a foreign
310 function, but aren't needed for call/return conventions of Haskell
313 - A MachRep is a basic machine type (non-void, doesn't contain
314 information on pointerhood or signedness, but contains some
315 reps that don't have corresponding Haskell types).
321 | IntRep -- signed, word-sized
322 | WordRep -- unsinged, word-sized
323 | Int64Rep -- signed, 64 bit (32-bit words only)
324 | Word64Rep -- unsigned, 64 bit (32-bit words only)
325 | AddrRep -- a pointer, but not to a Haskell value
330 %************************************************************************
332 \subsection{TyCon Construction}
334 %************************************************************************
336 Note: the TyCon constructors all take a Kind as one argument, even though
337 they could, in principle, work out their Kind from their other arguments.
338 But to do so they need functions from Types, and that makes a nasty
339 module mutual-recursion. And they aren't called from many places.
340 So we compromise, and move their Kind calculation to the call site.
343 mkFunTyCon :: Name -> Kind -> TyCon
346 tyConUnique = nameUnique name,
352 -- This is the making of a TyCon. Just the same as the old mkAlgTyCon,
353 -- but now you also have to pass in the generic information about the type
354 -- constructor - you can get hold of it easily (see Generics module)
355 mkAlgTyCon name kind tyvars stupid rhs sel_ids is_rec gen_info gadt_syn
358 tyConUnique = nameUnique name,
360 tyConArity = length tyvars,
361 tyConTyVars = tyvars,
362 algTcStupidTheta = stupid,
364 algTcSelIds = sel_ids,
365 algTcClass = Nothing,
367 algTcGadtSyntax = gadt_syn,
368 hasGenerics = gen_info
371 mkClassTyCon name kind tyvars rhs clas is_rec
374 tyConUnique = nameUnique name,
376 tyConArity = length tyvars,
377 tyConTyVars = tyvars,
378 algTcStupidTheta = [],
381 algTcClass = Just clas,
383 algTcGadtSyntax = False, -- Doesn't really matter
388 mkTupleTyCon name kind arity tyvars con boxed gen_info
390 tyConUnique = nameUnique name,
395 tyConTyVars = tyvars,
397 hasGenerics = gen_info
400 -- Foreign-imported (.NET) type constructors are represented
401 -- as primitive, but *lifted*, TyCons for now. They are lifted
402 -- because the Haskell type T representing the (foreign) .NET
403 -- type T is actually implemented (in ILX) as a thunk<T>
404 mkForeignTyCon name ext_name kind arity
407 tyConUnique = nameUnique name,
410 primTyConRep = PtrRep, -- they all do
412 tyConExtName = ext_name
416 -- most Prim tycons are lifted
417 mkPrimTyCon name kind arity rep
418 = mkPrimTyCon' name kind arity rep True
420 mkVoidPrimTyCon name kind arity
421 = mkPrimTyCon' name kind arity VoidRep True
423 -- but RealWorld is lifted
424 mkLiftedPrimTyCon name kind arity rep
425 = mkPrimTyCon' name kind arity rep False
427 mkPrimTyCon' name kind arity rep is_unlifted
430 tyConUnique = nameUnique name,
434 isUnLifted = is_unlifted,
435 tyConExtName = Nothing
438 mkSynTyCon name kind tyvars rhs
441 tyConUnique = nameUnique name,
443 tyConArity = length tyvars,
444 tyConTyVars = tyvars,
448 mkCoercionTyCon name arity kindRule
451 tyConUnique = nameUnique name,
456 -- Super kinds always have arity zero
457 mkSuperKindTyCon name
460 tyConUnique = nameUnique name
465 isFunTyCon :: TyCon -> Bool
466 isFunTyCon (FunTyCon {}) = True
469 isAbstractTyCon :: TyCon -> Bool
470 isAbstractTyCon (AlgTyCon { algTcRhs = AbstractTyCon }) = True
471 isAbstractTyCon _ = False
473 makeTyConAbstract :: TyCon -> TyCon
474 makeTyConAbstract tc@(AlgTyCon {}) = tc { algTcRhs = AbstractTyCon }
475 makeTyConAbstract tc = pprPanic "makeTyConAbstract" (ppr tc)
477 isPrimTyCon :: TyCon -> Bool
478 isPrimTyCon (PrimTyCon {}) = True
479 isPrimTyCon _ = False
481 isUnLiftedTyCon :: TyCon -> Bool
482 isUnLiftedTyCon (PrimTyCon {isUnLifted = is_unlifted}) = is_unlifted
483 isUnLiftedTyCon (TupleTyCon {tyConBoxed = boxity}) = not (isBoxed boxity)
484 isUnLiftedTyCon _ = False
486 -- isAlgTyCon returns True for both @data@ and @newtype@
487 isAlgTyCon :: TyCon -> Bool
488 isAlgTyCon (AlgTyCon {}) = True
489 isAlgTyCon (TupleTyCon {}) = True
490 isAlgTyCon other = False
492 isDataTyCon :: TyCon -> Bool
493 -- isDataTyCon returns True for data types that are represented by
494 -- heap-allocated constructors.
495 -- These are srcutinised by Core-level @case@ expressions, and they
496 -- get info tables allocated for them.
497 -- True for all @data@ types
498 -- False for newtypes
500 isDataTyCon tc@(AlgTyCon {algTcRhs = rhs})
504 AbstractTyCon -> pprPanic "isDataTyCon" (ppr tc)
506 isDataTyCon (TupleTyCon {tyConBoxed = boxity}) = isBoxed boxity
507 isDataTyCon other = False
509 isNewTyCon :: TyCon -> Bool
510 isNewTyCon (AlgTyCon {algTcRhs = NewTyCon {}}) = True
511 isNewTyCon other = False
513 isProductTyCon :: TyCon -> Bool
515 -- has *one* constructor,
516 -- is *not* existential
518 -- may be DataType, NewType
519 -- may be unboxed or not,
520 -- may be recursive or not
522 isProductTyCon tc@(AlgTyCon {}) = case algTcRhs tc of
523 DataTyCon{ data_cons = [data_con] }
524 -> isVanillaDataCon data_con
527 isProductTyCon (TupleTyCon {}) = True
528 isProductTyCon other = False
530 isSynTyCon :: TyCon -> Bool
531 isSynTyCon (SynTyCon {}) = True
534 isGadtSyntaxTyCon :: TyCon -> Bool
535 isGadtSyntaxTyCon (AlgTyCon { algTcGadtSyntax = res }) = res
536 isGadtSyntaxTyCon other = False
538 isEnumerationTyCon :: TyCon -> Bool
539 isEnumerationTyCon (AlgTyCon {algTcRhs = DataTyCon { is_enum = res }}) = res
540 isEnumerationTyCon other = False
542 isTupleTyCon :: TyCon -> Bool
543 -- The unit tycon didn't used to be classed as a tuple tycon
544 -- but I thought that was silly so I've undone it
545 -- If it can't be for some reason, it should be a AlgTyCon
547 -- NB: when compiling Data.Tuple, the tycons won't reply True to
548 -- isTupleTyCon, becuase they are built as AlgTyCons. However they
549 -- get spat into the interface file as tuple tycons, so I don't think
551 isTupleTyCon (TupleTyCon {}) = True
552 isTupleTyCon other = False
554 isUnboxedTupleTyCon :: TyCon -> Bool
555 isUnboxedTupleTyCon (TupleTyCon {tyConBoxed = boxity}) = not (isBoxed boxity)
556 isUnboxedTupleTyCon other = False
558 isBoxedTupleTyCon :: TyCon -> Bool
559 isBoxedTupleTyCon (TupleTyCon {tyConBoxed = boxity}) = isBoxed boxity
560 isBoxedTupleTyCon other = False
562 tupleTyConBoxity tc = tyConBoxed tc
564 isRecursiveTyCon :: TyCon -> Bool
565 isRecursiveTyCon (AlgTyCon {algTcRec = Recursive}) = True
566 isRecursiveTyCon other = False
568 isHiBootTyCon :: TyCon -> Bool
569 -- Used for knot-tying in hi-boot files
570 isHiBootTyCon (AlgTyCon {algTcRhs = AbstractTyCon}) = True
571 isHiBootTyCon other = False
573 isForeignTyCon :: TyCon -> Bool
574 -- isForeignTyCon identifies foreign-imported type constructors
575 isForeignTyCon (PrimTyCon {tyConExtName = Just _}) = True
576 isForeignTyCon other = False
578 isSuperKindTyCon :: TyCon -> Bool
579 isSuperKindTyCon (SuperKindTyCon {}) = True
580 isSuperKindTyCon other = False
582 isCoercionTyCon_maybe :: TyCon -> Maybe (Arity, [Type] -> Kind)
583 isCoercionTyCon_maybe (CoercionTyCon {tyConArity = ar, coKindFun = rule})
585 isCoercionTyCon_maybe other = Nothing
587 isCoercionTyCon (CoercionTyCon {}) = True
588 isCoercionTyCon other = False
592 -----------------------------------------------
593 -- Expand type-constructor applications
594 -----------------------------------------------
597 tcExpandTyCon_maybe, coreExpandTyCon_maybe
599 -> [Type] -- Args to tycon
600 -> Maybe ([(TyVar,Type)], -- Substitution
601 Type, -- Body type (not yet substituted)
602 [Type]) -- Leftover args
604 -- For the *typechecker* view, we expand synonyms only
605 tcExpandTyCon_maybe (SynTyCon {tyConTyVars = tvs, synTcRhs = rhs }) tys
607 tcExpandTyCon_maybe other_tycon tys = Nothing
610 -- For the *Core* view, we expand synonyms only as well
612 coreExpandTyCon_maybe (AlgTyCon {algTcRec = NonRecursive, -- Not recursive
613 algTcRhs = NewTyCon { nt_etad_rhs = etad_rhs, nt_co = Nothing }}) tys
614 = case etad_rhs of -- Don't do this in the pattern match, lest we accidentally
615 -- match the etad_rhs of a *recursive* newtype
616 (tvs,rhs) -> expand tvs rhs tys
618 coreExpandTyCon_maybe tycon tys = tcExpandTyCon_maybe tycon tys
622 expand :: [TyVar] -> Type -- Template
624 -> Maybe ([(TyVar,Type)], Type, [Type]) -- Expansion
626 = case n_tvs `compare` length tys of
627 LT -> Just (tvs `zip` tys, rhs, drop n_tvs tys)
628 EQ -> Just (tvs `zip` tys, rhs, [])
635 tyConHasGenerics :: TyCon -> Bool
636 tyConHasGenerics (AlgTyCon {hasGenerics = hg}) = hg
637 tyConHasGenerics (TupleTyCon {hasGenerics = hg}) = hg
638 tyConHasGenerics other = False -- Synonyms
640 tyConDataCons :: TyCon -> [DataCon]
641 -- It's convenient for tyConDataCons to return the
642 -- empty list for type synonyms etc
643 tyConDataCons tycon = tyConDataCons_maybe tycon `orElse` []
645 tyConDataCons_maybe :: TyCon -> Maybe [DataCon]
646 tyConDataCons_maybe (AlgTyCon {algTcRhs = DataTyCon { data_cons = cons }}) = Just cons
647 tyConDataCons_maybe (AlgTyCon {algTcRhs = NewTyCon { data_con = con }}) = Just [con]
648 tyConDataCons_maybe (TupleTyCon {dataCon = con}) = Just [con]
649 tyConDataCons_maybe other = Nothing
651 tyConFamilySize :: TyCon -> Int
652 tyConFamilySize (AlgTyCon {algTcRhs = DataTyCon { data_cons = cons }}) = length cons
653 tyConFamilySize (AlgTyCon {algTcRhs = NewTyCon {}}) = 1
654 tyConFamilySize (TupleTyCon {}) = 1
656 tyConFamilySize other = pprPanic "tyConFamilySize:" (ppr other)
659 tyConSelIds :: TyCon -> [Id]
660 tyConSelIds (AlgTyCon {algTcSelIds = fs}) = fs
661 tyConSelIds other_tycon = []
663 algTyConRhs :: TyCon -> AlgTyConRhs
664 algTyConRhs (AlgTyCon {algTcRhs = rhs}) = rhs
665 algTyConRhs (TupleTyCon {dataCon = con}) = DataTyCon { data_cons = [con], is_enum = False }
666 algTyConRhs other = pprPanic "algTyConRhs" (ppr other)
670 newTyConRhs :: TyCon -> ([TyVar], Type)
671 newTyConRhs (AlgTyCon {tyConTyVars = tvs, algTcRhs = NewTyCon { nt_rhs = rhs }}) = (tvs, rhs)
672 newTyConRhs tycon = pprPanic "newTyConRhs" (ppr tycon)
674 newTyConRep :: TyCon -> ([TyVar], Type)
675 newTyConRep (AlgTyCon {tyConTyVars = tvs, algTcRhs = NewTyCon { nt_rep = rep }}) = (tvs, rep)
676 newTyConRep tycon = pprPanic "newTyConRep" (ppr tycon)
678 newTyConCo :: TyCon -> Maybe TyCon
679 newTyConCo (AlgTyCon {tyConTyVars = tvs, algTcRhs = NewTyCon { nt_co = co }}) = co
680 newTyConCo tycon = pprPanic "newTyConCo" (ppr tycon)
682 tyConPrimRep :: TyCon -> PrimRep
683 tyConPrimRep (PrimTyCon {primTyConRep = rep}) = rep
684 tyConPrimRep tc = ASSERT(not (isUnboxedTupleTyCon tc)) PtrRep
688 tyConStupidTheta :: TyCon -> [PredType]
689 tyConStupidTheta (AlgTyCon {algTcStupidTheta = stupid}) = stupid
690 tyConStupidTheta (TupleTyCon {}) = []
691 tyConStupidTheta tycon = pprPanic "tyConStupidTheta" (ppr tycon)
695 synTyConDefn :: TyCon -> ([TyVar], Type)
696 synTyConDefn (SynTyCon {tyConTyVars = tyvars, synTcRhs = ty}) = (tyvars,ty)
697 synTyConDefn tycon = pprPanic "getSynTyConDefn" (ppr tycon)
699 synTyConRhs :: TyCon -> Type
700 synTyConRhs tc = synTcRhs tc
704 maybeTyConSingleCon :: TyCon -> Maybe DataCon
705 maybeTyConSingleCon (AlgTyCon {algTcRhs = DataTyCon {data_cons = [c] }}) = Just c
706 maybeTyConSingleCon (AlgTyCon {algTcRhs = NewTyCon { data_con = c }}) = Just c
707 maybeTyConSingleCon (AlgTyCon {}) = Nothing
708 maybeTyConSingleCon (TupleTyCon {dataCon = con}) = Just con
709 maybeTyConSingleCon (PrimTyCon {}) = Nothing
710 maybeTyConSingleCon (FunTyCon {}) = Nothing -- case at funty
711 maybeTyConSingleCon tc = pprPanic "maybeTyConSingleCon: unexpected tycon " $ ppr tc
715 isClassTyCon :: TyCon -> Bool
716 isClassTyCon (AlgTyCon {algTcClass = Just _}) = True
717 isClassTyCon other_tycon = False
719 tyConClass_maybe :: TyCon -> Maybe Class
720 tyConClass_maybe (AlgTyCon {algTcClass = maybe_clas}) = maybe_clas
721 tyConClass_maybe ther_tycon = Nothing
725 %************************************************************************
727 \subsection[TyCon-instances]{Instance declarations for @TyCon@}
729 %************************************************************************
731 @TyCon@s are compared by comparing their @Unique@s.
733 The strictness analyser needs @Ord@. It is a lexicographic order with
734 the property @(a<=b) || (b<=a)@.
737 instance Eq TyCon where
738 a == b = case (a `compare` b) of { EQ -> True; _ -> False }
739 a /= b = case (a `compare` b) of { EQ -> False; _ -> True }
741 instance Ord TyCon where
742 a <= b = case (a `compare` b) of { LT -> True; EQ -> True; GT -> False }
743 a < b = case (a `compare` b) of { LT -> True; EQ -> False; GT -> False }
744 a >= b = case (a `compare` b) of { LT -> False; EQ -> True; GT -> True }
745 a > b = case (a `compare` b) of { LT -> False; EQ -> False; GT -> True }
746 compare a b = getUnique a `compare` getUnique b
748 instance Uniquable TyCon where
749 getUnique tc = tyConUnique tc
751 instance Outputable TyCon where
752 ppr tc = ppr (getName tc)
754 instance NamedThing TyCon where