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
- Models dependent steps in interpretable domain-specific scripts, passing operation results to the remaining computation.
- How deep it goes
- Works through typed continuation fields, free-monad chaining, functor composition, and interpreter execution.
- Examples
- Uses controller setup and sensor reporting, a sandwich recipe, and a terminal read-and-echo script.
- What you can do after
- Builds continuation-based domain scripts and a free-monad interpreter that passes results into subsequent steps.
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 →
Also covered in
- Think Distributed Systems
- Quarkus in Action
- Pro ASP.NET Core 7, Tenth Edition
- C# Concurrency: Asynchronous and multithreaded programming
What to know first
- parallelismParallelism is the execution of multiple independent tasks or computational operations at the same time rather than sequentially.
- closureA closure is a function together with access to bindings from the lexical environment in which it was created.
- curryingCurrying is the transformation of a function that accepts multiple arguments into a sequence of functions that accept arguments incrementally, typically one at a time.
- exceptionAn exception is a runtime signal or value representing an abnormal condition that interrupts ordinary program flow and can be handled or propagated.
Related concepts
- middlewareused by · Middleware is software that mediates communication or processing between components, often by intercepting, transforming, or coordinating operations in a pipeline.
- 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’s result, which may become available later and may be pending or complete.
- std::shared_futureused by · A C++ standard library class template that allows multiple objects to access the same asynchronous result.
Questions about continuation
What is continuation?
A continuation is a representation or function of the computation that remains to be performed after a given operation or program point.
Which Manning books explain continuation?
Functional Design and Architecture: Examples in Haskell, C++ Concurrency in Action, Second Edition, Functional Programming in C#, Second Edition and Functional Programming in Scala, Second Edition.
What should I know before learning continuation?
Manning books that teach continuation usually introduce parallelism, closure, currying and exception first.
What kinds of continuation are there?
Kinds of continuation include serializable continuation.
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.



