开发者

Generating programs with Haskell

I need to auto-generate some programs with Haskell. What is the best architecture for this, which enforce semantic rules with the t开发者_如何学Cype system, or other haskell-cleverness? Otherwise I would just have lists of statements:

type program = [Statement]
data Statement = 
   Variable x |
   IfStatement Condition [Statement] |
   ...


If you mean you are generating haskell, check out Template Haskell


Perhaps you'll like to have a look at HStringTemplate. It could help if You are already experienced with "StringTemplate" (which was implemented in Java initially?).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜