package algaeff
Reusable Effects-Based Components
Install
Dune Dependency
Authors
Maintainers
Sources
1.0.0.tar.gz
md5=203805788d40cba3bfa6f86f689f2561
sha512=865e575963b04d20711f4b2f7f95444c58ed039700a6771cf41088f05a0032c7b04190e9692a3e38cef93c976c9a0bb8a058466da11b871be84d344397e04a50
Description
This OCaml library collects reusable effects-based components we have identified while developing our proof assistants based on algebraic effects.
Published: 21 Sep 2023
README
README.markdown
# 🦠 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. ## Stability ⚠ The API is experimental and unstable. We will break things! ## Components - [Algaeff.State](https://redprl.org/algaeff/algaeff/Algaeff/State): mutable states - [Algaeff.Reader](https://redprl.org/algaeff/algaeff/Algaeff/Reader): read-only environments - [Algaeff.Sequencer](https://redprl.org/algaeff/algaeff/Algaeff/Sequencer): making a `Seq.t` - [Algaeff.Mutex](https://redprl.org/algaeff/algaeff/Algaeff/Mutex): simple locking to prevent re-entrance - [Algaeff.UniqueID](https://redprl.org/algaeff/algaeff/Algaeff/UniqueID): generating unique IDs - [Algaeff.Unmonad](https://redprl.org/algaeff/algaeff/Algaeff/Unmonad): effects for any monadic operations Effects-based concurrency (cooperative lightweight threading) was already tackled by other libraries such as [Eio](https://github.com/ocaml-multicore/eio) and [Affect](https://erratique.ch/software/affect). This library focuses on the rest. There are a few other useful functions: - [Algaeff.Fun.Deep.finally](https://redprl.org/algaeff/algaeff/Algaeff/Fun/Deep/index.html#val-finally): call `continue` or `discontinue` accordingly. - [Algaeff.Fun.Shallow.finally\_with](https://redprl.org/algaeff/algaeff/Algaeff/Fun/Shallow/index.html#val-finally_with): same as above, but for shallow effect handlers. ## How to Use It ### OCaml >= 5.0.0 You need OCaml 5. ### Example Code ```ocaml module S = Algaeff.State.Make (struct type state = int end) 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.](https://redprl.org/algaeff/algaeff/Algaeff)
Dev Dependencies (3)
-
odoc
with-doc
-
qcheck-core
>= "0.18" & with-test
-
alcotest
>= "1.5" & with-test
Used by (3)
-
asai
< "0.3.0"
-
forester
>= "2.1" & < "3.0.0"
-
yuujinchou
>= "3.0.0" & < "5.2.0"
Conflicts
None
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page