next up previous contents
Next: Changing the arity of Up: Higher Order Functions Previous: Higher Order Functions   Contents

Creating a new function by composition: `compose'

This abstraction takes two input functions as input arguments and returns a new function composed ot the two inputs.

This lambda-abstraction is very useful for example in defining the abstractions for addition and multiplication. See also section basic:add and basic:mult.

(define compose 
   (lambda (f g)
      (lambda (x)
         (f (g x)))))

Georg P. Loczewski 2004-03-05

Impressum und Datenschutz