Add curry and uncurry functions
let curry f x y = f (x, y)
let uncurry f (x, y) = f x y
As implemented in Fsharpx. I have a sample implementation here:
Many thanks for this suggestion. It is being marked as declined – for discussion see the comments above.
Further comments, use cases, information and discussion welcome
Don Syme, F# Language and Core Library Evolution.
Don Syme commented
F# has no flip/curry/uncurry operators in the prelude - we did consider them of course in F# 1.x but made a definite decision not to include them. OCaml made the same decision at that time. Code that uses these is often of reduced readability. Not always, but in my experience too often.
Isaac Abraham commented
There's also ||> for uncurrying as well.
Patrick McDonald commented
It seems F# already has the uncurry function, AKA the "backward double pipe" operator (<||)
I don't think the curry function can be implemented as an operator as it takes 3 arguments.
Also, it seems curry/uncurry has been discarded as an idea previously, from reading this discussion [although this discussion doesn't mention the existence of (<||)]:
Pierre Irrmann commented
I was about to suggest the same one this morning! I give it my last remaining 2 votes...