OCaml syntax rewriter that turns let%continue bindings into callback function calls
  • OCaml 69.5%
  • Shell 19.1%
  • Makefile 11.4%
Find a file
2018-09-07 13:00:00 +00:00
.gitignore Build the PPX executable with compiler-libs and make 2018-09-07 11:00:00 +00:00
continuum_ppx.install Build the PPX executable with compiler-libs and make 2018-09-07 11:00:00 +00:00
continuum_ppx.ml Implement continuation expansion with the OCaml AST mapper 2018-09-07 10:00:00 +00:00
continuum_ppx.opam Build the PPX executable with compiler-libs and make 2018-09-07 11:00:00 +00:00
Makefile Build the PPX executable with compiler-libs and make 2018-09-07 11:00:00 +00:00
README.md Build the PPX executable with compiler-libs and make 2018-09-07 11:00:00 +00:00
test.ml Test nested callbacks, patterns, evaluation count, and exceptions 2018-09-07 12:00:00 +00:00
test_errors.sh Check diagnostics for recursive and simultaneous bindings 2018-09-07 13:00:00 +00:00

continuum_ppx

An OCaml syntax rewriter for callback-based functions:

let%continue x = producer in body

expands to producer (fun x -> body). The let%cps spelling also works. Patterns and nested bindings are supported. Recursive bindings and simultaneous and bindings produce a compiler error.

Build and test with make test. Compile a consumer with ocamlc -ppx ./continuum_ppx example.ml. The executable uses OCaml's bundled compiler libraries and must match the consumer's compiler version.

Install from this directory with OPAMBUILDTEST=true opam pin add continuum_ppx .. The package installs the continuum_ppx executable; it needs no external OCaml libraries or build tools beyond make.