Lists: updates the definition of a higher-order function
This commit is contained in:
parent
0d020a2a33
commit
fc517356a7
1 changed files with 1 additions and 1 deletions
|
@ -468,7 +468,7 @@ Now the time to reverse a list is linear in the length of the list.
|
||||||
|
|
||||||
Map applies a function to every element of a list to generate a corresponding list.
|
Map applies a function to every element of a list to generate a corresponding list.
|
||||||
Map is an example of a _higher-order function_, one which takes a function as an
|
Map is an example of a _higher-order function_, one which takes a function as an
|
||||||
argument and returns a function as a result:
|
argument or returns a function as a result:
|
||||||
\begin{code}
|
\begin{code}
|
||||||
map : ∀ {A B : Set} → (A → B) → List A → List B
|
map : ∀ {A B : Set} → (A → B) → List A → List B
|
||||||
map f [] = []
|
map f [] = []
|
||||||
|
|
Loading…
Reference in a new issue