(* FIRST_ARG (F,X) -- F is a binary function (its argument is a pair) X is suitable as the first component of F's argument FIRST_ARG (F,X) returns a unary function G such that (G Y) = F (X,Y) e.g. Given: fun F (X:int,Y) = X + Y; FIRST_ARG (F,1) would be the "increment" function *) fun FIRST_ARG (F,X) = fn Y => F (X,Y); local fun F (X:int,Y) = X + Y in val increment = FIRST_ARG (F,1) end;