[Haskell-cafe] Template Haskell a Permanent solution?

Henning Thielemann lemming at henning-thielemann.de
Mon Dec 27 12:49:05 CET 2010

On Mon, 27 Dec 2010, Jonas Almström Duregård wrote:

> Hi Henning,
> > I also think that Template Haskell is used too much. Several
> > things that are done in existing libraries could be done in plain
> > Haskell in a better way.
> Can you give any examples of this? I'm not saying it's not true, I'm just curious as to why you
> would venture into the realm of TH without a reason.

E.g. refer to the recent discussion of storable-endian.


Or look into package 'encoding'. It uses TemplateHaskell in order to 
convert Text descriptions of character sets into Haskell tables. I think 
the character tables could be simply rewritten to Haskell syntax, or they 
could be parsed by a function, where the parsed content is unfolded at 
compile time. It could even be computed at runtime, since it is only 
computed once because of laziness.

More information about the Haskell-Cafe mailing list