Friday, November 30, 2012

Boolean operators in F# are just fucntions.

Of course, F# has its boolean operators.
> true || false;;
val it : bool = true
> true && false;;
val it : bool = false
But, these are syntax sugar. && and || are not only operators but also functions!
> (||) true false;;
val it : bool = true
> (&&) true false;;
val it : bool = false
I have never known the fact until reading "Programming F# 3.0, 2nd Edition".

No comments:

Post a Comment