diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-09-17 02:20:53 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-09-17 02:20:53 +0000 |
| commit | 272ac23caa835faede38156699b40f884ad2ed11 (patch) | |
| tree | 894ad3517b4ba8e331712bc0d6af50fa5ae24263 /lib | |
| parent | ccfb6d58dc469a8f8a7e2e09bd520aea71f8cbf3 (diff) | |
| download | RNT-272ac23caa835faede38156699b40f884ad2ed11.tar.gz RNT-272ac23caa835faede38156699b40f884ad2ed11.zip | |
Use handles as reference points
Diffstat (limited to '')
| -rw-r--r-- | lib/evaluators/FOL.ml | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/evaluators/FOL.ml b/lib/evaluators/FOL.ml index 70cf9de..257ea86 100644 --- a/lib/evaluators/FOL.ml +++ b/lib/evaluators/FOL.ml @@ -9,25 +9,23 @@ module Error = struct condition "evaluation-cancelled" "An evaluation was stopped before it produced its result" empty end -type plan = Base of string +type plan = Base of Protocols.Handle.t + | Project of plan * string BatFingerTree.t module Program = Protocols.Program.Make (struct type t = plan end) -let execute context = function - | Base name -> - let open Utilities.Result in - match context.Protocols.Context.status () with - | `Cancelled | `Exhausted -> Error (Error.cancelled ()) - | `Live -> - let* found = Runtime.Context.resolve context name in - let* handle = Option.to_result ~none:(Error.unknown_relation name) found in - Fun.protect - ~finally:(fun () -> Protocols.Handle.release handle) - (fun () -> - let* enumerable = Protocols.Enumerable.require handle in - Protocols.Enumerable.enumerate enumerable context) +let execute context = + let open Utilities.Result in + function + | Base relation_handle -> + Fun.protect + ~finally:(fun () -> Protocols.Handle.release relation_handle) + (fun () -> + let* enumerable = Protocols.Enumerable.require relation_handle in + Protocols.Enumerable.enumerate enumerable context) + | Project (_plan, _attributes) -> failwith "TODO" class evaluator = object (self) inherit Kernel.Lifecycle.null |
