next up previous contents
Next: Converting all elements in Up: Higher Order Functions Previous: Creating a new function   Contents


Changing the arity of a function:`curry'

This abstraction takes a function as an argument that expects two arguments and returns a function expecting only one argument. That this abstraction can be very useful is shown below introducing the abstraction `mapc'.

The `curry' abstraction is named after the logician H.B. Curry.

(define curry 
   (lambda(f)
      (lambda(x)
         (lambda(y)
            (f x y)))))



Georg P. Loczewski 2004-03-05


Impressum und Datenschutz