diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-09-11 04:06:52 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-11 01:06:52 -0300 |
| commit | b79224410f469a1cd4ff3be4f8e62d71398109fc (patch) | |
| tree | e025feebbdf9703ce790b4a97cb9997242c9bb4b /lib/kernel/SubstantialRelation.ml | |
| parent | efe8032f7e224c29fc67a4f8cfd52db908442eec (diff) | |
| download | RNT-b79224410f469a1cd4ff3be4f8e62d71398109fc.tar.gz RNT-b79224410f469a1cd4ff3be4f8e62d71398109fc.zip | |
Multigroup objects
Diffstat (limited to 'lib/kernel/SubstantialRelation.ml')
| -rw-r--r-- | lib/kernel/SubstantialRelation.ml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/kernel/SubstantialRelation.ml b/lib/kernel/SubstantialRelation.ml index 8658f87..eebae3e 100644 --- a/lib/kernel/SubstantialRelation.ml +++ b/lib/kernel/SubstantialRelation.ml @@ -78,6 +78,9 @@ module Make (S : Abstract.Storage.STORAGE) = struct Ok {heading; predicate; local_constraints; tuples; indexes} end + let encode = Representation.to_blob + let decode = Representation.of_blob + let heading {heading; _} = heading let predicate {predicate; _} = predicate let local_constraints {local_constraints; _} = local_constraints @@ -133,10 +136,11 @@ module Make (S : Abstract.Storage.STORAGE) = struct let* data = SI.get_req tx (S.Hash addr) in Representation.of_blob data + let wrap conn relation = + new relation conn relation |> Protocols.Handle.make |> Result.ok + let load tx conn addr = - let open Utilities.Result in - let* relation = load_value tx addr in - Ok (new relation conn relation |> Protocols.Handle.make) + load_value tx addr |> Utilities.Result.fmap (wrap conn) let assert_tuple tx relation tuple = let open Utilities.Result in |
