Join
A monadic operation that flattens a nested monadic value by removing one layer of structure.
Functional Programming in Scala, Second Edition
join is a monadic combinator that flattens a nested monadic value into a single monadic layer.
- How it is used
- Flattens nested effectful computations so later work can depend on earlier results.
- How deep it goes
- Defines join by type and implementation, then derives flatMap and restates associativity through join.
- Examples
- Uses nested Par computations, Option lookups, and associativity interpretations for Par and Parser.
- What you can do after
- Build it from scratch with flatMap or implement flatMap from map and join.
Read how Functional Programming in Scala, Second Edition explains join →
Functional Programming in JavaScript
A monadic operation that removes one layer of nesting from a monadic structure.
- How it is used
- Flattens nested monadic results after chaining monad-returning functions.
- How deep it goes
- Defines join by example and shows recursive flattening, but stops short of formal laws or broader monad API details.
- Examples
- Uses nested Wrapper values, composed student lookup, and an array flatten analogy.
- What you can do after
- Operate nested monadic results by collapsing them into one layer for further access.
Read how Functional Programming in JavaScript explains join →
Fabulous Adventures in Data Structures and Algorithms
Join is a monadic operation that removes one level of nesting from a nested monad.
- How it is used
- Flattens nested monadic workflows, including probability distributions that produce further distributions.
- How deep it goes
- Defines nesting removal, derives it through Bind and identity, and demonstrates it with probability and dice examples.
- Examples
- Uses mixed dice distributions and sneezing conditioned on a cold prior to show concrete flattening and marginalization.
- What you can do after
- Apply it via Bind and the identity function to flatten nested monadic values in C#.
Read how Fabulous Adventures in Data Structures and Algorithms explains join →
What to know first
- functorA functor is an abstraction that maps values or objects while preserving the structure and relationships of their surrounding context.
- data transformationA data transformation is an operation that maps input data or representations to output by changing their values, structure, or form.
- stateState is information describing the condition or configuration of a system or computation at a particular time that may influence its behavior or subsequent transitions.
- identity functionAn identity function maps every input to itself unchanged.
Related concepts
- monadused by · A monad is a programming abstraction that provides operations for sequencing computations while encapsulating and preserving their computational context.
- flatmapequivalent to · FlatMap is an operation that maps each element to a sequence or computational context and combines the resulting sequences or contexts into a flattened result.
- type-lifting functioncontrasts with · A type-lifting function embeds a value into a corresponding computational context, container, or type, often a monadic type.
Questions about join
What is join?
A monadic operation that flattens a nested monadic value by removing one layer of structure.
Which Manning books explain join?
Functional Programming in Scala, Second Edition, Functional Programming in JavaScript and Fabulous Adventures in Data Structures and Algorithms.
What should I know before learning join?
Manning books that teach join usually introduce functor, data transformation, state and identity function first.
What is the difference between join and type-lifting function?
A monadic operation that flattens a nested monadic value by removing one layer of structure. A type-lifting function embeds a value into a corresponding computational context, container, or type, often a monadic type.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


