Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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