Originally posted by bytebuster463 at Sequential comparison in F#
This kind of questions becomes more and more popular:
if(x == y && y == z).
I wish I could write
if(x == y and z)but there is no syntax for that. What can I do?
let inline mOp1<'a> op sample x = op sample x, sample
let inline mOp2<'a> op1 op2 (b, sample) x = op1 b (op2 sample x), sample
// Implementation for (=) and (&&)
let (==) = mOp1 (=)
let (&=) = mOp2 (&&) (=)
let ret1 = a == b &= c &= d &= e |> fst
P.S. If you like it, you may upvote it on StackOverflow. :)