|
|
Examples of filtering | As we did for mapping, we will also here study a number of examples. As before,
we arrange the examples in a table where the example expressions are shown to the left, and their
values to the right. |
| In the first row we filter the first five natural numbers with the even? predicate. In the second row, we filter the same list of numbers with the odd? predicate.
Rather than using the name odd? we form it by calculating (negate even?) . We have
seen the higher-order function negate earlier in this lecture. |