16 - Functional Programming Flashcards
(7 cards)
What is a key feature of functional programming languages regarding data structures?
Data structures/variables are immutable, meaning the state/values cannot be changed after they are created.
What does it mean for functions in functional programming languages to be stateless?
Functions do not have side-effects; the output depends only on inputs and is not influenced by stored state.
What are higher-order functions in functional programming?
Functions that can take a function as an argument and/or return a function as a result.
What is an example of a higher-order function?
Map and fold.
How can the order of execution be determined in functional programming languages?
The order can be determined at run-time by the translator/compiler/interpreter.
True or False: In functional programming, the order of execution is defined by the program code.
False.
Fill in the blank: A higher-order function is a function that takes a _______ as an argument.
function.