Examples ======== All examples are in the `examples/ `_ directory. .. list-table:: :header-rows: 1 :widths: 30 70 * - Example - Description * - `N-Queens `_ - Backtracking search via multi-shot continuations * - `Amb / Logic puzzle `_ - Scheme-style ``amb`` operator and constraint solving (SICP Exercise 4.42) * - `Probability `_ - Exact discrete probability distributions via weighted multi-shot * - `Dependency injection `_ - Swap DB/email/logging implementations * - `Record/Replay `_ - Record effect results, replay without side effects * - `Transactions `_ - Buffer writes, commit on success, rollback on failure * - `Automatic differentiation `_ - Forward-mode (dual numbers) and reverse-mode (backpropagation) * - `Shallow state machine `_ - Mutable state (get/put) and traffic light controller * - `shift/reset, shift0/reset0 `_ - Delimited continuations: deep = shift/reset, shallow = shift0/reset0