X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FTyCon.lhs;h=f03fb8952ef8a7626f51695871e0b28cab11a53a;hb=0da2eb6b04a57947fd2b32da9a648ad5eeeb6596;hp=31cb19b23ae60630d0e2644887c4f344b777d34b;hpb=0cb269be72ffe42498c74d5be845eb27d8818423;p=ghc-hetmet.git diff --git a/compiler/types/TyCon.lhs b/compiler/types/TyCon.lhs index 31cb19b..f03fb89 100644 --- a/compiler/types/TyCon.lhs +++ b/compiler/types/TyCon.lhs @@ -61,7 +61,7 @@ module TyCon( #include "HsVersions.h" -import {-# SOURCE #-} TypeRep ( Kind, Type, Coercion, PredType ) +import {-# SOURCE #-} TypeRep ( Kind, Type, PredType ) import {-# SOURCE #-} DataCon ( DataCon, isVanillaDataCon ) import Var ( TyVar, Id ) @@ -101,6 +101,8 @@ data TyCon tyConTyVars :: [TyVar], -- Scopes over (a) the algTcStupidTheta -- (b) the cached types in -- algTyConRhs.NewTyCon + -- (c) the family instance + -- types if present -- But not over the data constructors tyConArgPoss :: Maybe [Int], -- for associated families: for each @@ -183,8 +185,10 @@ data TyCon tyConUnique :: Unique, tyConName :: Name, tyConArity :: Arity, - coKindFun :: [Type] -> Kind - } + coKindFun :: [Type] -> (Type,Type) + } -- INVARAINT: coKindFun is always applied to exactly 'arity' args + -- E.g. for trans (c1 :: ta=tb) (c2 :: tb=tc), the coKindFun returns + -- the kind as a pair of types: (ta,tc) | SuperKindTyCon { -- Super Kinds, TY (box) and CO (diamond). -- They have no kind; and arity zero @@ -192,10 +196,6 @@ data TyCon tyConName :: Name } -type KindCon = TyCon - -type SuperKindCon = TyCon - type FieldLabel = Name data AlgTyConRhs @@ -657,7 +657,7 @@ isSuperKindTyCon :: TyCon -> Bool isSuperKindTyCon (SuperKindTyCon {}) = True isSuperKindTyCon other = False -isCoercionTyCon_maybe :: TyCon -> Maybe (Arity, [Type] -> Kind) +isCoercionTyCon_maybe :: TyCon -> Maybe (Arity, [Type] -> (Type,Type)) isCoercionTyCon_maybe (CoercionTyCon {tyConArity = ar, coKindFun = rule}) = Just (ar, rule) isCoercionTyCon_maybe other = Nothing