
6 Aug
2007
6 Aug
'07
10:49 p.m.
On Monday 06 August 2007, Rahul Kapoor wrote:
I am having problems coming up with nice combinators for a simple DSEL. The abstract syntax is simply given by the types:
<snip>
Or is it a better idea to just remove the precedence rules from the types and move it the part of the code that evaluates the expressions?
Exactly thus. Say: data SearchCondition = Constant Bool | SearchCondition :||: SearchCondition | SearchCondition :&&: SearchCondition infixr 3 (:&&:) infixr 2 (:||:) And you're set. Jonathan Cast http://sourceforge.net/projects/fid-core http://sourceforge.net/projects/fid-emacs