I'm trying to define an overloaded operator, e.g. |+|
, as the following:
let inline ( |+| ) (m1 : #IMeasurable) (m2 : #IMeasurable) = m1.Measure + m2.Measure
The problem is, I can't do something like:
let three = m1 |+| m2 |+| m3
Because the operator |+|
isn't defined for the case (m1 : int) (m2 : #IMeasurable)
. Is there a way to overload this operator or use static type constraints to make the above expression possible? Is there a way to modify IMeasurable
(which I can edit) so that this is possible? Anything else that would allow the above expression to work?
Thank you.