Show experience of constructing simple programs in a functional programming language.
A function is higher-order if it takes a function as an argument or returns a function as a result, or does both.
Function | Use | Example |
---|---|---|
map | Applying a function to every element in a list | map (+2) [1..10] - adds two to every element |
filter | Filtering a list based on a provided function | filter (<5) [1..10] - returns elements less than 5 |
reduce / fold | Reduces a list of values to a single value by applying a combining function to the list |