Alex
Alex

Reputation: 7919

Is there a pre-existing function to pass a tuple as args?

I want to apply a regular function that takes two arguments to a tuple. I defined a helper function like so:

let apply f (a, b) =
    f a b

However I feel like this must be a fairly common use case and wondered if it was a function in the standard library (I'm not sure what terms to search for)

Upvotes: 4

Views: 146

Answers (1)

Daniel
Daniel

Reputation: 47904

The double forward pipe (||>) does this.

Upvotes: 6

Related Questions