Continuations provide a means whereby heap space can be traded for stack depth (heap space being generally more plentiful than stack depth). They are especially useful where tail recursion is not possible. Here are a couple of simple continuation examples that can be extended to cover more complex scenarios.
89 people like thisPosted: 9 years ago by Neil Carrier
A combinator based DSL for composing type-safe parameterized sql queries. Inspired by Olivier Danvy's "Functional Unparsing" paper.
10 people like thisPosted: 9 years ago by Nick Palladinos
An implementation of Coroutine by using a continuation monad. It's using a monad library [1]. [1] https://github.com/fsharp/fsharpx
7 people like thisPosted: 9 years ago by einblicker
This snippet implements a semi-coroutine by continuations.
4 people like thisPosted: 8 years ago by einblicker
yin-yang puzzle, based on https://groups.google.com/forum/#!msg/comp.lang.scheme/Fysq_Wplxsw/awxEZ_uxW20J
0 people like thisPosted: 3 years ago by NIck Palladinos
you can easily find how to use continuations to iterate over a binary tree but what if the count of children for each node is not known at design time? It's not so obvious how to do this in order to get a tail-recursive method. This short snippet shows how to do this to sum the values of every leaf. The second part demonstrates a general approach for other operations than addition.
25 people like thisPosted: 9 years ago by Carsten König
An iteratee that uses continuation-passing style as an optimization. There is no more discriminated union, and the signature should feel familiar to those using Async.StartWithContinuations.
5 people like thisPosted: 9 years ago by Ryan Riley
Oleg's delimited continuation monad [1] and creating an external iterator from an internal iterator using it. [1] http://okmij.org/ftp/continuations/implementations.html#genuine-shift
6 people like thisPosted: 9 years ago by einblicker
Delimited continuations encoded as a parameterized continuation monad.
1 people like thisPosted: 7 years ago by Nick Palladinos
Basic implementation of the continuation monad with explanation.
8 people like thisPosted: 8 months ago by Brian Berns