diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-07 18:25:43 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-07 18:25:43 -0300 |
| commit | 932e657e38665afa1da1aab549977841abbd9dcf (patch) | |
| tree | b2c0b3d30b7aaab7347300b3932a9f03e4f64f9a /lib/kernel/View.ml | |
| parent | cfc641a9bb97c94e5993f895a8bcdf24214adc83 (diff) | |
| download | RNT-932e657e38665afa1da1aab549977841abbd9dcf.tar.gz RNT-932e657e38665afa1da1aab549977841abbd9dcf.zip | |
drop journal in favor of local branch history
Diffstat (limited to '')
| -rw-r--r-- | lib/kernel/View.ml | 44 | ||||
| -rw-r--r-- | lib/kernel/View.mli | 21 |
2 files changed, 0 insertions, 65 deletions
diff --git a/lib/kernel/View.ml b/lib/kernel/View.ml deleted file mode 100644 index b90afef..0000000 --- a/lib/kernel/View.ml +++ /dev/null @@ -1,44 +0,0 @@ -type heading = Protocols.Schematics.attribute_description BatMap.String.t -type rows = (Concepts.Tuple.t list, Concepts.Condition.condition) result - -let ephemeral heading enumerate = - EphemeralRelation.instantiate heading - {EphemeralRelation.name= None; schematics= `Temporary heading; program= None} - (fun () -> - Result.map - (fun tuples -> Generator.cursor_of (fun ~yield -> List.iter yield tuples; Ok ())) - (enumerate ()) ) - -let fixed heading tuples = ephemeral heading (fun () -> Ok tuples) - -let computed heading ~current compute = - let open Utilities.Result in - let now = ephemeral heading (fun () -> current () |> fmap compute) in - Prototype.mixture - ( Protocols.Derived.make - object - method within directory = Ok (ephemeral heading (fun () -> compute directory)) - end - :: Protocols.Handle.protocols now ) - -let read relation = - let open Utilities.Result in - let* schematics = Protocols.Handle.require Protocols.Schematics.from relation in - let* description = Protocols.Schematics.describe schematics in - let* heading = - match description with - | Protocols.Schematics.Relation heading -> Ok heading - | _ -> - Error - Concepts.Condition.( - condition "not-a-relation" "The object does not describe itself as a relation" - ("object" |=| Concepts.Value.String (Protocols.Handle.to_string relation)) ) - in - let* enumerable = Protocols.Enumerable.require relation in - let* cursor = Protocols.Enumerable.enumerate enumerable in - Fun.protect - ~finally:(fun () -> Protocols.Handle.release cursor) - (fun () -> - let* scan = Protocols.Cursor.require cursor in - let* tuples = Protocols.Cursor.drain scan () in - Ok (heading, BatFingerTree.to_list tuples) ) diff --git a/lib/kernel/View.mli b/lib/kernel/View.mli deleted file mode 100644 index 04e75ff..0000000 --- a/lib/kernel/View.mli +++ /dev/null @@ -1,21 +0,0 @@ -(** relations as values a subsystem hands to the tree. *) - -type heading = Protocols.Schematics.attribute_description BatMap.String.t -type rows = (Concepts.Tuple.t list, Concepts.Condition.condition) result - -(** a relation holding [tuples], which never changes. *) -val fixed : heading -> Concepts.Tuple.t list -> Protocols.Handle.t - -(** a relation computed from a directory of relations. Read as it is, it - is computed against [current ()] each time; read through a snapshot, - it is computed against the snapshot instead (see [Protocols.Derived]), - so it is what it was, or would be, at that moment. *) -val computed : - heading -> - current:(unit -> (Protocols.Handle.t, Concepts.Condition.condition) result) -> - (Protocols.Handle.t -> rows) -> - Protocols.Handle.t - -(** the heading and tuples of a relation, read whole. *) -val read : - Protocols.Handle.t -> (heading * Concepts.Tuple.t list, Concepts.Condition.condition) result |
