Templates in FPL?
Jerzy Karczmarczuk
karczma@info.unicaen.fr
Wed, 23 May 2001 18:46:02 +0200
Fergus Henderson :
> I agree that it would be very nice if Haskell and other FPLs had some
> equivalent feature, with a nicer syntax. I think you might be able to
> do a lot of it using ordinary Haskell syntax with just some additional
> annotation that directs the compiler to evaluate part of the program at
> compile time.
Actually, whole my posting was driven by that. (And by Clean macros which
are not macros, but not yet templates, and by the fact that you can
parameterize templates with constants, and Haskell classes not).
Yours anwers, very thorough, concentrated sometimes on the realization
of templates in C++, and I am the last to defend them, or to want to see
them implemented in Haskell. But, as a - not too run-time-expensive way
to deal with some facets of polymorphism by compiling specialized functions,
it is a possible option. The syntactic issues, and the relation of these
"macros" to class system is another story.
Thanks.
Jerzy Karczmarczuk
Caen, France