Explore tens of thousands of sets crafted by our community.
Functional Programming Concepts
20
Flashcards
0/20
Closures
A closure is a function paired with a reference to its outer scope's variables. Closures allow a function to access those captured variables through its scope chain even when the function is executed outside of its defining scope.
Continuations
Continuations represent the state of a program at a particular point in time, and can be used to resume execution at that point after a potentially complex operation.
Higher-Order Functions
Higher-order functions are functions that can take other functions as arguments or return them as results.
Immutable Data
Immutable data means that it is unable to be changed once created. Functional programming often emphasizes using immutable data structures.
Recursion
Recursion is a method of solving a problem where a function calls itself as a subroutine.
Pure Functions
A pure function is a function where the return value is only determined by its input values, without observable side effects.
Function Composition
Function composition is the process of combining two or more functions to produce a new function. Composing functions f and g creates a function h such that .
Referential Transparency
Referential transparency is a property of parts of a program where expressions can be replaced by their values without affecting the program's behavior.
Type Inference
Type inference is the automatic detection of the data type of an expression in a programming language.
First-Class Functions
First-class functions are functions that are treated like any other variable. They can be passed as arguments, returned by another function, or assigned as a value to a variable.
Pattern Matching
Pattern matching is a feature that allows you to match values against patterns and bind variables with values that are part of the pattern.
Functors
A functor is a type that implements a map operation which applies a function to each value in its context, while preserving the structure of the context.
Monads
Monads are design patterns in functional programming to describe computations as a series of steps. Monads provide a way to structure programs and handle side effects.
Currying
Currying is the transformation of a function with multiple arguments into a series of functions that each take a single argument.
Lazy Evaluation
Lazy evaluation is a call-by-need evaluation mechanism which delays the evaluation of an expression until its value is needed, and avoids repeated evaluations.
Tail Recursion
Tail recursion is a special case of recursion where the last action of a function is a call to itself and may be optimized by the compiler to iterative loops to improve performance.
Algebraic Data Types
Algebraic Data Types (ADTs) are types formed by combining other types, allowing for more complex data structures typically using 'sum' and 'product' type combinations.
Memoization
Memoization is an optimization technique used to speed up computer programs by storing the results of expensive function calls and reusing them when the same inputs occur again.
Side Effects
Side effects are changes to the state of the program or interaction with external systems that occur while evaluating an expression or function.
Declarative Programming
Declarative programming is a programming paradigm that expresses the logic of a computation without describing its control flow, typically found in functional programming.
© Hypatia.Tech. 2024 All rights reserved.