functional-programming - Concepts
Explore concepts tagged with "functional-programming"
Total concepts: 14
Concepts
- Side Effects - Observable changes to state or interactions with the outside world that occur during the execution of a function or operation.
- Parse, Don't Validate - Turn untrusted input into precise, typed data at the edge of your system, instead of checking it and passing the same loose data along.
- Property-Based Testing - A testing approach where you describe properties that must hold for all inputs, and a framework generates hundreds of random test cases to try to break them.
- Functional Core, Imperative Shell - An architecture pattern where all decisions live in pure functions at the center, and a thin outer layer handles the side effects: reading input, talking to the network, writing to disk.
- Total Functions - A total function returns a valid result for every possible input of its type; a partial function only works for some inputs and crashes, throws or misbehaves on the others.
- Immutability - The property of data that cannot be changed after it is created, so any modification produces a new value rather than altering the original.
- Smart Constructor - A function that is the only way to create a value of a given type and that checks the type's rules, so every value that exists is guaranteed to be valid.
- Algebraic Data Types - Composite types built by combining other types in two ways: "and" (product types, like records) and "or" (sum types, like tagged unions), which lets you model a domain precisely.
- Lambda Calculus - A formal system introduced by Alonzo Church for expressing computation through function abstraction and application, equivalent in power to Turing machines and foundational to functional programming.
- Pure Functions - Functions that always return the same output for the same input and produce no side effects.
- Make Illegal States Unrepresentable - Design your data types so that invalid combinations of values simply can't be created, and let the compiler catch a whole class of bugs for you.
- Memoization - An optimization that caches the result of an expensive function call and returns the stored result whenever the same inputs occur again.
- Option Type - A type that makes the possible absence of a value explicit: a value is either present (Some(x)) or absent (None), and the compiler forces you to handle both cases.
- Out of the Tar Pit - An influential 2006 paper by Ben Moseley and Peter Marks arguing that complexity is the single largest source of failure in software, and proposing a discipline of avoiding it through state minimization and functional design.
← Back to all concepts