samoht / effects-examples

Examples to illustrate the use of algebraic effects in Multicore OCaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OCaml effects examples

Build Status

Examples to illustrate the use of algebraic effects in OCaml. See

Examples

The original implementation of Multicore OCaml allowed a user to Obj.clone_continuation. This has been removed, the examples that used this are in the multishot directory. See this conversation about the removal of this feature. They now use the ocaml-multicont library.

Running the examples

To run the examples with Multicore OCaml, be sure to install Opam with these instructions.

# After cloning this repository, create a 5.0.0 switch
$ opam update
# Add the alpha repository to get unreleased 5.0.0 compatible libraries
$ opam switch create 5.0.0+trunk --repo=default,alpha=git+https:://github.com/kit-ty-kate/opam-alpha-repository.git
$ opam install . --deps-only
$ make

This builds all of the examples. If you want to run a single executable that is build with dune you can run:

$ dune exec -- ./<executable_name>.exe

External examples

These are other examples that utilise OCaml effect handlers that are not in this repo:

About

Examples to illustrate the use of algebraic effects in Multicore OCaml

License:ISC License


Languages

Language:OCaml 94.7%Language:Haskell 2.4%Language:Makefile 2.1%Language:C 0.8%