On Fri, Jul 11, 2008 at 5:13 PM, Roberto Zunino <[EMAIL PROTECTED]> wrote:
> 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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to