
11 Jul
2008
11 Jul
'08
7:59 p.m.
On Fri, Jul 11, 2008 at 5:13 PM, Roberto Zunino
Ron Alford wrote:
instance Typeable1 f => Typeable (Expr f) where typeOf (In x) = mkTyConApp (mkTyCon "TypeTest.Expr") [typeOf1 x]
typeOf ~(In x) = mkTyConApp (mkTyCon "TypeTest.Expr") [typeOf1 x]
Yes, that works, but what would also work is this: newtype Expr f = In (f (Expr f)) Keeping the typeOf code the same as the original. I would consider this more correct, since this is a type trick, not a value trick. The data definition makes your model have an extra bottom, which can't be very attractive! Luke