Fundamentals of Functional Programming Flashcards
What is meant by the term ‘Domain’?
Set from which the functions input values are chosen
What is meant by the term ‘Co-Domain’?
Set from which the functions output values are chosen
What is a Higher-order Function?
A function which takes another function as an argument and/or returns a function
What does the ‘map’ higher-order function do?
Applies a given function to each element of a list, returning a list of results
What does the ‘filter’ higher-order function do?
Processes a data structure, typically a list, in some order to produce a new data structure containing the elements from the original data structure that match the given condition
What does the ‘reduce’ or ‘fold’ higher-order function do?
Reduces a list of values to a single value by repeatedly applying a combining function to a list of values
What is partial function application?
The process of fixing arguments of a function, producing another function with less arguments. For example:
function add(a,b) = a + b
becomes…
function addTwo(a) = a + 2
What is a first-class object?
First-class objects in functional programming are entities that can be passed as arguments to functions, returned from functions, and assigned to variables.