On Friday 04 March 2005 23:44, Keean Schupke wrote:
> Benjamin Franksen wrote:
> >Consider:
> >
> >     class Bogus a b
> >     instance Bogus Int Char
> >
> >How do you express the /instance/ in TH? Using AppT?
>
> That would be:
>
> (using 6.4 syntax)
>
> AppT (AppT (ConT (mkName "Bogus")) (ConT ''Int)) (ConT ''Char)
>
> If the instance is using type variables:
>
> instance Bogus Int a
>
> you get:
>
> AppT (AppT (ConT (mkName "Bogus")) (ConT ''Int)) (VarT (mkName "a"))

OK, I can see now that this makes sense syntactically. Still, it is strange 
that the class name is handled as if it were a type constructor.

Anyway, thanks.

Ben
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to