On Mon, Nov 09, 2009 at 10:05:43PM +0000, John Moore wrote:
> How do I turn a value into an expression
> I want to do for e.g. 8 - 1 turn it into (subtract (Val8) (Val1)
> Any ideas
Is this a homework problem?
One good approach would be to make a data type Expr which represents
expressions. It will have a constructor Val, a constructor Subtract,
etc., one constructor for each operation you want to have in your
expressions. Then make Expr an instance of the Num type class.