Skip to content

Examples to illustrate the use of algebraic effects in Multicore OCaml

License

Notifications You must be signed in to change notification settings

vimcy7/effects-examples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. If your version of Opam (opam --version) is greater than or equal to 2.1 then the following instructions will work:

# 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

If your version of Opam is less than 2.1, then you will also need to add the beta repository when creating the switch. All of the other commands remain the same.

opam switch create 5.0.0+trunk --repo=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git,alpha=git+https://github.com/kit-ty-kate/opam-alpha-repository.git

Running make will build all of the examples. If you want to run a single executable that is built 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:

Citation

If you are citing this work in an academic paper, please cite the PLDI 2021 paper "Retrofitting Effect Handlers onto OCaml": https://dl.acm.org/doi/10.1145/3453483.3454039.

About

Examples to illustrate the use of algebraic effects in Multicore OCaml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • OCaml 95.4%
  • Haskell 2.1%
  • Makefile 1.8%
  • C 0.7%