[Haskell-cafe] Is Template Haskell a suitable macro language?

Josef Svenningsson josef.svenningsson at gmail.com
Tue Apr 24 12:06:17 EDT 2007

On 4/24/07, Jacques Carette <carette at mcmaster.ca> wrote:
> In Ocaml, you can frequently use polymorphic variants to get the same
> effect.
> Which means that if you are willing to do enough type-class-hackery, it
> should, in principle, be possible to do the same in Haskell.  But it
> sure isn't as convenient!
You seem to imply that there is an encoding of polymorphic variants in
Haskell using type classes. While I know that it's possible to achieve
similar effects using type classes I haven't seen a direct encoding.
If there is such an encoding I would be very interested to hear about

> This all points to some clear need for more ``flavours'' of polymorphism
> being needed (in Haskell), to be able to express *in the type system*
> what TH allows you to say "outside".
I totally agree with this.



More information about the Haskell-Cafe mailing list