RedPRL / algaeff

🦠 Reusable components based on algebraic effects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🦠 Reusable Effects-Based Components

This library aims to collect reusable, general effects-based components we have seen when constructing our proof assistants using OCaml 5. All components here have appeared in various tutorials on algebraic effects; algaeff wraps these well-known components into an OPAM package.

API Stability

We use semantic versioning. Breaking changes will bump the major version number.

Components

Effects-based concurrency (cooperative lightweight threading) was already tackled by other libraries such as Eio and Affect. This library focuses on the rest.

There are a few other useful functions:

How to Use It

OCaml >= 5.0.0

You need OCaml 5.

Example Code

module S = Algaeff.State.Make (Int)

let forty_two = S.run ~init:100 @@ fun () ->
  print_int (S.get ()); (* this will print out 100 *)
  S.set 42;
  S.get ()

Documentation

Here is the API documentation.

About

🦠 Reusable components based on algebraic effects

License:Apache License 2.0


Languages

Language:OCaml 100.0%