Continuation
A continuation is a representation or function of the computation that remains to be performed after a given operation or program point.
Functional Design and Architecture: Examples in Haskell
A continuation is a function representing the remainder of a computation and receiving the result of an intermediate operation.
- How it is used
- Connects domain actions by feeding an interpreted result into the script that follows.
- How deep it goes
- Works through typed action constructors, free-monad chaining, Functor composition, and recursive interpreter execution.
- Examples
- Uses controller setup and sensor reading, sandwich construction, and terminal input followed by output.
- What you can do after
- Build it from scratch as typed result-dependent actions, then interpret the resulting free-monadic scripts.
Read how Functional Design and Architecture: Examples in Haskell explains continuation →
C++ Concurrency in Action, Second Edition
A continuation is a function scheduled to run automatically after an asynchronous computation reaches a specified completion point.
- How it is used
- Schedules result processing when a future becomes ready, avoiding an explicit wait for each stage.
- How deep it goes
- Works through `then()` ownership, arguments, chaining and execution-thread uncertainty, then identifies the limit posed by blocking backend calls.
- Examples
- Uses future-validity checks, a chained login workflow, and gathering results from multiple futures.
- What you can do after
- Apply it via `std::experimental::future::then()` to chain asynchronous operations and handle their results or exceptions.
Read how C++ Concurrency in Action, Second Edition explains continuation →
Functional Programming in C#, Second Edition
A continuation represents the remaining computation, typically as a function that receives a value and proceeds from it.
- How it is used
- Uses continuations to compose middleware pipelines without deeply nested callbacks.
- How deep it goes
- Explains the middleware signature and implements Bind, Map, and typed execution with Run.
- Examples
- Uses connection, transaction, logging, and timing middleware, including a database deletion pipeline.
- What you can do after
- Apply it via C# delegates and LINQ to compose and run middleware pipelines.
Read how Functional Programming in C#, Second Edition explains continuation →
Functional Programming in Scala, Second Edition
A continuation is a representation of the computation that should proceed after an asynchronous result becomes available.
- How it is used
- Represents deferred control flow after synchronous or asynchronous computations produce results.
- How deep it goes
- Explains continuations as stored functions, interpreter steps, callback interfaces, and compositional wrappers.
- Examples
- Uses IO constructors, repeated printLine actions, asynchronous byte reads, and callback-wrapped Future values.
- What you can do after
- Apply it via IO, Future, and Par to represent and compose computations that resume after results arrive.
Read how Functional Programming in Scala, Second Edition explains continuation →
Related concepts
- free monadused by · A free monad represents computations as composable syntax over an operation set, with interpretation and execution supplied separately.
- futureused by · A future is an abstraction representing an asynchronous computation or its eventual result, which may not yet be available.
- std::shared_futureused by · A C++ standard library class template that allows multiple objects to access the same asynchronous result.
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.



