Snippets tagged continuations

  • sum the nodes in a (not-binary) tree using continuations

    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 this

    Posted: 7 years ago by Carsten K├Ânig

  • IterateeCPS

    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 this

    Posted: 7 years ago by Ryan Riley

  • Delimited Continuation Monad

    Oleg's delimited continuation monad [1] and creating an external iterator from an internal iterator using it. [1]

    6 people like this

    Posted: 7 years ago by einblicker

  • Delimited continuations

    Delimited continuations encoded as a parameterized continuation monad.

    1 people like this

    Posted: 5 years ago by Nick Palladinos