How to create a non-TH package from code generated using Template Haskell?

若如初见. 提交于 2019-12-05 03:11:38
Joachim Breitner

There are tools for it:

Disclaimer: I have not tried any of these myself.

It's always possible to just write a Haskell program that outputs Haskell source code as an ordinary text file. You can then compile that like any other file.

What this doesn't give you, of course:

  • Syntax checking. (I.e., the code you generate might contain syntax errors.)
  • The ability to inspect hand-written code already compiled.
  • The ability to use other GHC features like type inference.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!