SLR25 Functional programming paradigms Flashcards
Domain
“A set form which a function’s input values are chosen.”
Co-domain
“A set from which the function’s output values are chosen. Not all need to be outputs.”
First-class object
“Objects which may: 1) appear in expressions 2) be assigned to a variable 3) be assigned as arguments 4) be returned in function calls.”
Function application
“The process of giving particular inputs to a function.”
Partial function application
“The process of fixing several arguments to a function, producing another function which has a smaller number of arguments.”
Composition of functions
“The process of applying one function to the results of another.”
Higher-order functions
“A function that takes a function as an argument, returns a function as a result or does both.”
Map
“The name of a higher-order function that applies a given function to each element of a list, returning a list of results.”
Filter
“The name of 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.”
Reduce or fold
“The name of a higher-order function which reduces a list of values to a single value by repeatedly applying a combining function to the list values.”
“A set form which a function’s input values are chosen.”
Domain
“A set from which the function’s output values are chosen. Not all need to be outputs.”
Co-domain
“Objects which may: 1) appear in expressions 2) be assigned to a variable 3) be assigned as arguments 4) be returned in function calls.”
First-class object
“The process of giving particular inputs to a function.”
Function application
“The process of fixing several arguments to a function, producing another function which has a smaller number of arguments.”
Partial function application