liveBook · Manning

Continuation

A continuation is a representation or function of the computation that remains to be performed after a given operation or program point.

How 4 Manning books explain it

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

What to know first

Related concepts

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.