Fundamentals of functional programming Flashcards
Co-domain
A set from which the function’s output values are chosen.
Domain
A set from which the function’s input values are chosen.
Functions
A rule that, for each element in some set A of inputs, assigns an output chosen from set B, but without necessarily using every member of B.
First-class objects
First-class objects (or values) are objects which may appear in expressions, be assigned to a variable, be assigned as arguments or be returned in function calls.
Function application
The process of giving particular inputs to a function.
Partial function application
A function application scheme where a function is decomposed into intermediate partial functions. A partial function takes some of the arguments and returns a function awaiting the remaining arguments.
Composition of functions
The combination of two functions to produce a new function that performs the two functions in a specified order.
Filter
A higher-order function that processes a data structure, typically a list, in some order to produce a new data structure containing exactly those elements of the original data structure that match a given condition.
Functional programming
A programming paradigm where programs are constructed through the application and composition of functions.
Higher order functions
Functions which take function as an argument or return a function as result, or both.
Map
A higher-order function that applies a given function to each element of a list, returning a list of results.
Reduce/Fold
A higher-order function which reduces a list of values to a single value by repeatedly applying a combining function to the list values.
Append
Add an item to the end of a list.
Head-tail representation
A method of representing a list in two parts: a head which is the first element, and a tail which is itself a list of all the other elements.
Prepend
Add an item to the beginning of a list.