diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-09-26 15:30:53 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-09-26 15:30:53 -0300 |
| commit | e32ba6294781691846c3ab19281fe977350b4d0f (patch) | |
| tree | f38e92ba2fc03e966d7263c7ee2e0b5d7983ebae /prl_api | |
| parent | be375a52da6174dfda5b68617d27e1542cc80499 (diff) | |
| download | Sakura-e32ba6294781691846c3ab19281fe977350b4d0f.tar.gz Sakura-e32ba6294781691846c3ab19281fe977350b4d0f.zip | |
preparation cleanup for RNT integration
Diffstat (limited to 'prl_api')
| -rw-r--r-- | prl_api/dune | 3 | ||||
| -rw-r--r-- | prl_api/sakura_prl_api.ml | 26 |
2 files changed, 0 insertions, 29 deletions
diff --git a/prl_api/dune b/prl_api/dune deleted file mode 100644 index 815a625..0000000 --- a/prl_api/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name sakura_prl_api) - (public_name sakura.prl_api)) diff --git a/prl_api/sakura_prl_api.ml b/prl_api/sakura_prl_api.ml deleted file mode 100644 index d1a6fcc..0000000 --- a/prl_api/sakura_prl_api.ml +++ /dev/null @@ -1,26 +0,0 @@ -type value = Obj.t -type tuple = (string * value) list - -type implementation = - { membership_criteria: (tuple -> (bool, string) result) option; - produce: (tuple -> (tuple list, string) result) option } - -(* TODO: Rethink this instead in terms of a value. - We need to store the references as a normal relation - on the multigroup relation catalog. *) -let registry : (string, implementation) Hashtbl.t = Hashtbl.create 32 -let mutex = Mutex.create () -let register symbol impl = Mutex.protect mutex (fun () -> Hashtbl.replace registry symbol impl) -let find symbol = Mutex.protect mutex (fun () -> Hashtbl.find_opt registry symbol) -let symbols () = Mutex.protect mutex (fun () -> Hashtbl.to_seq_keys registry |> List.of_seq) - -let implementation_of_rows ?membership_criteria (rows : tuple list) : implementation = - {membership_criteria; produce= Some (fun _bindings -> Ok rows)} - -let implementation_of_producer ?membership_criteria (produce : tuple -> (tuple list, string) result) - : implementation = - {membership_criteria; produce= Some produce} - -let implementation_of_unit_producer ?membership_criteria - (produce : unit -> (tuple list, string) result) : implementation = - {membership_criteria; produce= Some (fun _bindings -> produce ())} |
