I've always thought that F# had two different ways to pass arguments, curry style and tuple style. Is this actually correct?
Isn't it simply one style , curry style, and arguments can either be simple values or tuples.
e.g.
someFunc (a,b) =
isn't this a function with one curry style argument which happens to be a tuple ? Thus allowing me to pass tuples to this function using the pipleline operator? (where the elements of the tuple is named)
(1,2) |> someFunc
Is this correct?
This will work just fine - the difference is when you have
let f (a,b) = ...
let f2 a b = ...
then you can create a partially applied f2 easily, but for f it doesn't work quite as nicely - you have to do
let partial = fun t -> f (1,t)
let partial2 = f2 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With