0
comment
comment
on 9/17/2013 6:11 AM
In a recent StackOverflow question
the poster asked about the difference between tupled and curried form of a function in F#.
In F#, you can use pattern matching to easily define a function that takes a tuple as an argument.
For example, the poster's function was a simple calculation that multiplies the number
of units sold n by the price p:
1: let salesTuple (price, count) = price * (float count)
The function takes a single argument of type Tuple<float, int> (or, using the nicer F# notation
float * int[...]