From 80dca8dfa5cf89807f5606e6dc26586a3abdafc3 Mon Sep 17 00:00:00 2001 From: favonia Date: Tue, 31 Oct 2023 10:02:27 -0500 Subject: [PATCH] fix!: remove `Unmonad` (#25) fix!: remove Unmonad --- README.markdown | 1 - src/Algaeff.ml | 1 - src/Algaeff.mli | 2 -- test/TestReader.ml | 2 +- test/TestSequencer.ml | 2 +- test/TestState.ml | 2 +- {src => test}/Unmonad.ml | 0 {src => test}/Unmonad.mli | 0 test/dune | 28 ++++------------------------ 9 files changed, 7 insertions(+), 31 deletions(-) rename {src => test}/Unmonad.ml (100%) rename {src => test}/Unmonad.mli (100%) diff --git a/README.markdown b/README.markdown index f8224c0..2a0d414 100644 --- a/README.markdown +++ b/README.markdown @@ -13,7 +13,6 @@ We use [semantic versioning.](https://semver.org/) Breaking changes will bump th - [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. diff --git a/src/Algaeff.ml b/src/Algaeff.ml index ef14309..bf2c7bd 100644 --- a/src/Algaeff.ml +++ b/src/Algaeff.ml @@ -3,6 +3,5 @@ module Reader = Reader module Sequencer = Sequencer module Mutex = Mutex module UniqueID = UniqueID -module Unmonad = Unmonad module Sigs = Sigs module Fun = Fun diff --git a/src/Algaeff.mli b/src/Algaeff.mli index 4f48bd2..222ab0f 100644 --- a/src/Algaeff.mli +++ b/src/Algaeff.mli @@ -12,8 +12,6 @@ module Mutex = Mutex module UniqueID = UniqueID -module Unmonad = Unmonad - (** {1 Auxiliary modules} *) module Sigs = Sigs diff --git a/test/TestReader.ml b/test/TestReader.ml index cee4127..321168a 100644 --- a/test/TestReader.ml +++ b/test/TestReader.ml @@ -13,7 +13,7 @@ end module ReaderUnmonad = struct - module U = Algaeff.Unmonad.Make (ReaderMonad) + module U = Unmonad.Make (ReaderMonad) let read () = U.perform ReaderMonad.read let scope f m = U.perform @@ ReaderMonad.scope f @@ U.run m let run ~env f = U.run f env diff --git a/test/TestSequencer.ml b/test/TestSequencer.ml index 20e0b49..ea9d159 100644 --- a/test/TestSequencer.ml +++ b/test/TestSequencer.ml @@ -22,7 +22,7 @@ end module SequencerUnmonad = struct - module U = Algaeff.Unmonad.Make (SequencerMonad) + module U = Unmonad.Make (SequencerMonad) let yield x = U.perform (SequencerMonad.yield x) let run f = output_to_seq @@ snd @@ U.run f let register_printer _ = () diff --git a/test/TestState.ml b/test/TestState.ml index 1ea9cca..9661dff 100644 --- a/test/TestState.ml +++ b/test/TestState.ml @@ -14,7 +14,7 @@ end module StateUnmonad = struct - module U = Algaeff.Unmonad.Make (StateMonad) + module U = Unmonad.Make (StateMonad) let get () = U.perform StateMonad.get let set s = U.perform @@ StateMonad.set s let modify f = U.perform @@ StateMonad.modify f diff --git a/src/Unmonad.ml b/test/Unmonad.ml similarity index 100% rename from src/Unmonad.ml rename to test/Unmonad.ml diff --git a/src/Unmonad.mli b/test/Unmonad.mli similarity index 100% rename from src/Unmonad.mli rename to test/Unmonad.mli diff --git a/test/dune b/test/dune index a18a35c..0de3dd6 100644 --- a/test/dune +++ b/test/dune @@ -1,27 +1,7 @@ -(test - (name TestState) - (modules TestState) - (libraries qcheck-core qcheck-core.runner algaeff)) - -(test - (name TestReader) - (modules TestReader) - (libraries qcheck-core qcheck-core.runner algaeff)) - -(test - (name TestSequencer) - (modules TestSequencer) - (libraries qcheck-core qcheck-core.runner algaeff)) - -(test - (name TestMutex) - (modules TestMutex) - (libraries alcotest algaeff)) - -(test - (name TestUniqueID) - (modules TestUniqueID) - (libraries qcheck-core qcheck-core.runner algaeff)) +(tests + (names TestState TestReader TestSequencer TestMutex TestUniqueID) + (modules TestState TestReader TestSequencer TestMutex TestUniqueID Unmonad) + (libraries qcheck-core qcheck-core.runner alcotest algaeff)) (test (name Example)