Feedback ML functions are Curried versions of Scheme functions 

Forum: U Chicago, Com Sci 221, autumn 2000
Re: News Assignment #7, due Monday 20 November (Mike O'Donnell)
Re: Question correspondence of arguments from Scheme to ML (Michael C. Brizic)
Date: 2000, Nov 18
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

Since the normal style of programming in ML uses Curried functions, it makes the most sense to let your ML functions be Curried versions of the Scheme functions. That is, let all ML functions take one argument, but they will typically return functions that take additional arguments.

For example, in Scheme we define apply as a 2-argument function by

(define (apply f x) (f x))
or, equivalently, by
(define apply (lambda (f x) (f x)))
The most natural thing in ML is to define apply as a 1-argument function that returns a 1-argument function. The beginning of such a definition looks like
fun apply f x =
We often think that this ML version of apply is a 2-argument function, but technically it's not. Since ML systematically represents multiple-argument functions by 1-argument higher-order functions, we usually don't get very excited about the difference. The Curried ML version of apply can do everything that the Scheme version can, plus a bit more, so it seems like a fair translation.



Mike O'D.


to: "ML functions are Curried versions of Scheme functions"