Operator Formula, :
type Formula =
| Operator of (string * Formula * Formula)
| Number of double
, Operator(name, left, right), Operator args, - :
let evalOp (name, l, r) = 0.0
let eval f =
match f with
| Number n -> 0.0
| Operator args -> evalOp args
, ( ):
type OperatorInfo = string * Formula * Formula
and Formula =
| Operator of OperatorInfo
| Number of double
, , :
type OperatorInfo =
{ Name : string
Left : Formula
Right : Formula }
and Formula =
| Operator of OperatorInfo
| Number of double
, :
| Operator args -> (...)
| Operator { Name = n; Left = l; Right = r } -> (...)