[Edit: oops, accientally posted twice]

By on 11/19/2008 7:20 PM ()

Hi,
I think that the easiest option would be to represent Add, Sub and Mul as a single binary operator:

1
2
3
4
5
6
7
 
type Operator =
  | Mul | Add | Sub
type Expression = 
  | Variable of string
  | Number of double
  | Binary of Operator * Expression * Expression

T.

By on 11/19/2008 7:20 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper