X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fext-core%2FCore.hs;h=0fb48b81d4f3200a83cf3fa72e2ce45a28be3b1a;hp=5f8ed827d5545fd9e576f88d157a7ed049d7c330;hb=e4417dcd4679da9c6b18c02ff667199c572bed89;hpb=2ad4df602e5bb2cff0315b945fa3201749878c30 diff --git a/utils/ext-core/Core.hs b/utils/ext-core/Core.hs index 5f8ed82..0fb48b8 100644 --- a/utils/ext-core/Core.hs +++ b/utils/ext-core/Core.hs @@ -9,14 +9,15 @@ data Module data Tdef = Data (Qual Tcon) [Tbind] [Cdef] - | Newtype (Qual Tcon) [Tbind] Axiom (Maybe Ty) + -- type constructor; coercion name; type arguments; type rep + -- If we have: (Newtype tc co tbs (Just t)) + -- there is an implicit axiom: + -- co tbs :: tc tbs :=: t + | Newtype (Qual Tcon) (Qual Tcon) [Tbind] (Maybe Ty) data Cdef = Constr (Qual Dcon) [Tbind] [Ty] --- Newtype coercion -type Axiom = (Qual Tcon, [Tbind], (Ty,Ty)) - data Vdefg = Rec [Vdef] | Nonrec Vdef @@ -60,6 +61,7 @@ data Ty | TransCoercion Ty Ty | SymCoercion Ty | UnsafeCoercion Ty Ty + | InstCoercion Ty Ty | LeftCoercion Ty | RightCoercion Ty @@ -132,9 +134,9 @@ eqKind Kunlifted Kunlifted = True eqKind Kopen Kopen = True eqKind (Karrow k1 k2) (Karrow l1 l2) = k1 `eqKind` l1 && k2 `eqKind` l2 -eqKind _ _ = False -- no Keq kind is ever equal to any other... - -- maybe ok for now? - +eqKind (Keq t1 t2) (Keq u1 u2) = t1 == u1 + && t2 == u2 +eqKind _ _ = False splitTyConApp_maybe :: Ty -> Maybe (Qual Tcon,[Ty]) splitTyConApp_maybe (Tvar _) = Nothing