Combinator
A combinator is a function or computational construct that combines, composes, or transforms smaller functions or computations into a larger operation.
Functional Programming in Scala, Second Edition
A combinator is a compositional operation that builds a larger computation from smaller functions or computational structures.
- How it is used
- Builds larger parallel computations, generators, properties, and parsers by composing smaller operations.
- How deep it goes
- Develops API refinement, primitive-versus-derived distinctions, laws, and implementations while deferring representation in algebraic parser design.
- Examples
- Uses parallel choice and lazyUnit, generator construction, property conjunction, and repeated alternative parsers.
- What you can do after
- Build composite operations from a minimal algebra and refine overly specific APIs into reusable combinators.
Read how Functional Programming in Scala, Second Edition explains combinator →
Functional Programming in JavaScript
A higher-order function that combines other functions to coordinate control flow or transformation in a functional program.
- How it is used
- Coordinates functional control flow without placing business logic or local variables inside the coordinating functions.
- How deep it goes
- Defines identity, tap, alternation, sequence, and fork with JavaScript implementations and worked compositions.
- Examples
- Uses student lookup, logging during validation, average-grade calculation, equality comparison, and Lodash chained transformations.
- What you can do after
- Apply combinators via Ramda and Lodash to compose transformations, choose alternatives, sequence actions, and combine results.
Read how Functional Programming in JavaScript explains combinator →
Functional Design and Architecture: Examples in Haskell
A combinator is a function or expression-building operation that combines smaller computational elements into a larger computation.
- How it is used
- Organizes functional interfaces and embedded domain-specific languages around small operations that compose into larger computations.
- How deep it goes
- Defines the compositional principle and gives representative APIs, but stops short of formal category-theoretic derivations or implementation internals.
- Examples
- Uses mapM, sequence, replicateM, lenses, and reactive streams as examples of composable functional operations.
- What you can do after
- Evaluate/understand functional interfaces by recognizing when small operations compose into reusable domain-specific behavior.
Read how Functional Design and Architecture: Examples in Haskell explains combinator →
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
A higher-order function or construct that builds a new operation by composing or transforming existing ones.
- How it is used
- Transforms observable streams into more specific streams by composing operations such as mapping and filtering.
- How deep it goes
- Defines combinators through subscription and new-observable creation, then walks through filtering; error and completion forwarding are deferred.
- Examples
- Uses a clock stream formatted into distinct time strings and a number stream filtered to odd values.
- What you can do after
- Build it from scratch by subscribing to an existing observable and forwarding transformed or selected values through a new observable.
Related concepts
- trampolineincludes · A trampoline is a control mechanism that repeatedly invokes returned functions or computation steps until a final value is produced.
- parser combinatorincludes · A parser combinator is a compositional function or operation that constructs larger parsers from existing parsers.
- higher-order functionuses · A higher-order function is a function that accepts functions as arguments, returns functions as results, or both.
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.



