Friday, December 14, 2012

Operators in F# (are also fucntions).

(In learning from "Programming F# 3.0, 2nd Edition")

Like as boolean operators in this article, a lot of operators in F# are also fucntions when using with surrounding parentheses.

> List.reduce (+) [1; 2; 3; 4; 5];;
val it : int = 15
> List.reduce (*) [1; 2; 3; 4; 5];;
val it : int = 120

No comments:

Post a Comment