{"id":19489331,"url":"https://github.com/redprl/algaeff","last_synced_at":"2025-08-14T08:35:16.764Z","repository":{"id":39719109,"uuid":"476037740","full_name":"RedPRL/algaeff","owner":"RedPRL","description":"🦠 Reusable components based on algebraic effects","archived":false,"fork":false,"pushed_at":"2024-09-28T23:36:59.000Z","size":711,"stargazers_count":49,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T02:11:42.780Z","etag":null,"topics":["algebraic-effects","ocaml","ocaml-library"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedPRL.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG.markdown","contributing":"CONTRIBUTING.markdown","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-30T20:16:48.000Z","updated_at":"2025-03-12T18:47:15.000Z","dependencies_parsed_at":"2024-11-21T00:32:25.251Z","dependency_job_id":null,"html_url":"https://github.com/RedPRL/algaeff","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedPRL%2Falgaeff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedPRL%2Falgaeff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedPRL%2Falgaeff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedPRL%2Falgaeff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedPRL","download_url":"https://codeload.github.com/RedPRL/algaeff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250872444,"owners_count":21500824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algebraic-effects","ocaml","ocaml-library"],"created_at":"2024-11-10T21:08:08.020Z","updated_at":"2025-04-25T18:33:02.527Z","avatar_url":"https://github.com/RedPRL.png","language":"OCaml","readme":"# 🦠 Reusable Effects-Based Components\n\nThis 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.\n\n## API Stability\n\nWe use [semantic versioning.](https://semver.org/) Breaking changes will bump the major version number.\n\n## Components\n\n- [Algaeff.State](https://redprl.org/algaeff/algaeff/Algaeff/State): mutable states\n- [Algaeff.Reader](https://redprl.org/algaeff/algaeff/Algaeff/Reader): read-only environments\n- [Algaeff.Sequencer](https://redprl.org/algaeff/algaeff/Algaeff/Sequencer): making a `Seq.t`\n- [Algaeff.Mutex](https://redprl.org/algaeff/algaeff/Algaeff/Mutex): simple locking to prevent re-entrance\n- [Algaeff.UniqueID](https://redprl.org/algaeff/algaeff/Algaeff/UniqueID): generating unique IDs\n\nEffects-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.\n\nThere are a few other useful functions:\n\n- [Algaeff.Fun.Deep.finally](https://redprl.org/algaeff/algaeff/Algaeff/Fun/Deep/index.html#val-finally): call `continue` or `discontinue` accordingly.\n- [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.\n\n## How to Use It\n\n### OCaml \u003e= 5.0.0\n\nYou need OCaml 5.\n\n### Example Code\n\n```ocaml\nmodule S = Algaeff.State.Make (Int)\n\nlet forty_two = S.run ~init:100 @@ fun () -\u003e\n  print_int (S.get ()); (* this will print out 100 *)\n  S.set 42;\n  S.get ()\n```\n\n### Documentation\n\n[Here is the API documentation.](https://redprl.org/algaeff/algaeff/Algaeff)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredprl%2Falgaeff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredprl%2Falgaeff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredprl%2Falgaeff/lists"}