Lecture overview -- Keyboard shortcut: 'u'  Previous page: Introduction to higher-order functions [Section] -- Keyboard shortcut: 'p'  Next page: Some simple and general higher-order functions -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home    Lecture 4 - Page 2 : 34
Functional Programming in Scheme
Higher-order Functions
Higher-order functions

The idea of higher-order functions is of central importance for the functional programming paradigm. As we shall see on this and the following pages, this stems from the fact that higher-order functions can be further generalized by accepting functions as parameters. In addition, higher-order functions may act as function generators, because they allow functions to be returned as the result from other functions.

A higher-order function accepts functions as arguments and is able to return a function as its result

A higher-order language supports higher-order functions and allows functions to be constituents of data structures

  • The order of data

    • Order 0: Non function data

    • Order 1: Functions with domain and range of order 0

    • Order 2: Functions with domain and range of order 1

    • Order k: Functions with domain and range of order k-1

Order 0 data have nothing to do with functions. Numbers, lists, and characters are example of such data.

Data of order 1 are functions which work on 'ordinary' order 0 data. Thus order 1 data are the functions we have been concerned with until now.

Data of order 2 - and higher - are example of the functions that have our interest in this lecture.

Functions of order i, i >= 2, are called higher-order functions