curry

Lib.curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c

Converts a function on a pair to a corresponding curried function.

The application curry f returns fn x => fn y => f(x,y), so that

   curry f x y = f(x,y)

Failure

A call curry f never fails; however, curry f x y fails if f (x,y) fails.

Example

> val increment = curry op+ 1;
val increment = fn: int -> int

> increment 6;
val it = 7: int

See also

Lib, Lib.uncurry