[Haskell-cafe] Re: Haskell vs OCaml
duncan.coutts at worc.ox.ac.uk
Thu May 5 05:24:44 EDT 2005
On Wed, 2005-05-04 at 18:29 -0400, Jacques Carette wrote:
> There is also Template Haskell vs MetaOCaml.
> For the life of me, I still cannot fathom why Template Haskell is untyped, while MetaOCaml is fully typed. Which is
> the main reason I write meta-program in MetaOCaml and 'other' programs in Haskell.
The reason for this is that Template Haskell is more powerful and
correspondingly harder to type so it is currently untyped.
The main reason it is more porwerful is that TH allows you to pattern
match on the abstract syntax of a quoted expression and perform
arbitrary transformations on that. It would be hard to preserve the
well-typedness of the AST and still allow arbitrary transformations.
A colleague of mine is currently developing a type system for Template
Haskell that should catch most errors without restricting too much the
programs you can write.
More information about the Haskell-Cafe