X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Ftypes%2FTypeRep.lhs;fp=compiler%2Ftypes%2FTypeRep.lhs;h=c12f9c89dbdf9dfcfca60d199486ec37d65d68b4;hb=15bea1b740be3d5ee755e0e7a7b214b587ad2205;hp=446341db80c52f872f10299d62ac1824f8b8949e;hpb=39bb1bd24f56d1abd9961813d9cd94b61c9d4c78;p=ghc-hetmet.git diff --git a/compiler/types/TypeRep.lhs b/compiler/types/TypeRep.lhs index 446341d..c12f9c8 100644 --- a/compiler/types/TypeRep.lhs +++ b/compiler/types/TypeRep.lhs @@ -145,11 +145,12 @@ data Type -- can appear as the right hand side of a type synonym. | FunTy - Type + Type Type -- ^ Special case of 'TyConApp': @TyConApp FunTyCon [t1, t2]@ + -- See Note [Equality-constrained types] | ForAllTy - TyCoVar -- ^ Type *or* coercion variable; see Note [Equality-constrained types] + TyCoVar -- Type variable Type -- ^ A polymorphic type | PredTy @@ -183,21 +184,9 @@ The type forall ab. (a ~ [b]) => blah is encoded like this: ForAllTy (a:*) $ ForAllTy (b:*) $ - ForAllTy (wild_co : a ~ [b]) $ + FunTy (PredTy (EqPred a [b]) $ blah -That is, the "(a ~ [b]) =>" part is encode as a for-all -type with a coercion variable that is never mentioned. - -We could instead have used a FunTy with an EqPred on the -left. But we want - - * FunTy to mean RUN-TIME abstraction, - passing a real value at runtime, - - * ForAllTy to mean COMPILE-TIME abstraction, - erased at runtime - ------------------------------------- Note [PredTy]