Hacker News new | past | comments | ask | show | jobs | submit login

So far as I'm aware, the drawbacks to Template Haskell are:

1) Debugging generated code can be a pain. To some degree this is true of most macro systems, but it certainly applies here.

2) It adds to build times, sometimes significantly.

3) There is an issue preventing use of Template Haskell when cross compiling.

Some other things of note:

The Haskell syntax is really complicated, compared to s-exprs. This is not entirely negative - variated syntax can help you know where you are in an expression and give more guidance when you mix things up - but it's not entirely positive either.

The stage restriction prevents using a piece of Template Haskell in the same module where you define it. For a lot of use cases, this doesn't matter... but it makes module-specific one-offs more awkward, moving their definition away from where they're relevant.

As of comparatively recent, there is "Typed Template Haskell". As originally conceived, Template Haskell generating an expression didn't "have to" produce an expression of the right type. Compilation would still fail once the type mismatch was detected, but further from the cause of the error.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: