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

2007-04-24 Thread Joel Reymont
I'm finding myself dealing with several large abstract syntax trees that are very similar in nature. The constructor names would be the same or one type may be a small extension of another. This is something that I wouldn't worry about with Lisp, for example, as I would create a bunch of

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

2007-04-24 Thread Robin Green
On Tue, 24 Apr 2007 14:23:47 +0100 Joel Reymont [EMAIL PROTECTED] wrote: I'm finding myself dealing with several large abstract syntax trees that are very similar in nature. The constructor names would be the same or one type may be a small extension of another. This is something that I

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

2007-04-24 Thread Jacques Carette
Magnus Jonsson wrote: I have the same problem too when using Haskell. The more I try to enforce static guarantees the more I get lots of datatypes that are similar except for one or two constructors. The best way I have found to avoid this is to simply give up on some of the static guarantees

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

2007-04-24 Thread Josef Svenningsson
On 4/24/07, Jacques Carette [EMAIL PROTECTED] 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

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

2007-04-24 Thread Jacques Carette
Josef Svenningsson wrote: On 4/24/07, Jacques Carette [EMAIL PROTECTED] 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