F # currying - a call with two parameters

I have a problem that boils down to the following example:

let func a b c = printf "%s %s %s" a b c
let partial = func "a"

let something_that_returns_two_parameters = "b", "c" // what to write here?

something_that_returns_two_parameters |> partial // what to write here?

My expected result: func is called with "a" "b" "c". I can edit the last two lines. As much as possible?

+4
source share
1 answer

You need to apply the tuple using the operator ||>:

something_that_returns_two_parameters ||> partial

This operator applies each component of a tuple to a function.

See F # Operators for reference.

+8
source

Source: https://habr.com/ru/post/1666486/


All Articles