aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/evaluators
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-10-12 11:58:25 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-10-12 11:58:25 -0300
commitad33454a204aa5791445e7d15f02ba0447fff85e (patch)
treeb1730a9ac5b40ff58ddc23976cd5df5dac924231 /test/unit/evaluators
parentd4f603fa04283efe54c79b5f7664c4c9bc193857 (diff)
downloadRNT-ad33454a204aa5791445e7d15f02ba0447fff85e.tar.gz
RNT-ad33454a204aa5791445e7d15f02ba0447fff85e.zip
relation scan with enumerable and release
Diffstat (limited to '')
-rw-r--r--test/unit/evaluators/FOL.ml13
1 files changed, 3 insertions, 10 deletions
diff --git a/test/unit/evaluators/FOL.ml b/test/unit/evaluators/FOL.ml
index 3254258..1782b2e 100644
--- a/test/unit/evaluators/FOL.ml
+++ b/test/unit/evaluators/FOL.ml
@@ -31,11 +31,7 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) =
let drain result =
let open Utilities.Result in
- let* enumerable = Protocols.Enumerable.require result in
- let* cursor = Protocols.Enumerable.enumerate enumerable in
- let* scan = Protocols.Cursor.require cursor in
- let* tuples = Protocols.Cursor.drain scan () in
- Protocols.Handle.release cursor;
+ let* tuples = Protocols.Enumerable.scan result (fun scan -> Protocols.Cursor.drain scan ()) in
Protocols.Handle.release result;
Ok (BatFingerTree.to_list tuples)
@@ -229,11 +225,8 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) =
begin
let open Utilities.Result in
let* result = values (counter ~produced ~closed ()) in
- let* enumerable = Protocols.Enumerable.require result in
- let* cursor = Protocols.Enumerable.enumerate enumerable in
- let* scan = Protocols.Cursor.require cursor in
- let* first = Protocols.Cursor.next scan in
- Protocols.Handle.release cursor; Protocols.Handle.release result; Ok first
+ let* first = Protocols.Enumerable.scan result Protocols.Cursor.next in
+ Protocols.Handle.release result; Ok first
end
|> Helpers.condition_as_failure
in