diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-09-13 02:31:39 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-09-13 02:31:39 -0300 |
| commit | 327d0d2a47591e02299d4e7360d5b7e03b4962d2 (patch) | |
| tree | 52d5ff1a51e7996da15816bc17a4dbaa15eac602 /lib/protocols | |
| parent | 28ddfe4cd64a228bedf4c9068f443643e8496f7e (diff) | |
| download | RNT-327d0d2a47591e02299d4e7360d5b7e03b4962d2.tar.gz RNT-327d0d2a47591e02299d4e7360d5b7e03b4962d2.zip | |
delete remaining trash
Diffstat (limited to '')
| -rw-r--r-- | lib/protocols/Context.ml | 30 | ||||
| -rw-r--r-- | lib/protocols/Context.mli | 15 |
2 files changed, 0 insertions, 45 deletions
diff --git a/lib/protocols/Context.ml b/lib/protocols/Context.ml deleted file mode 100644 index ea314a6..0000000 --- a/lib/protocols/Context.ml +++ /dev/null @@ -1,30 +0,0 @@ -module Error = struct - open Concepts.Condition - - let unresolved name = - condition "unresolved-name" "A name did not resolve to any object reachable from this context" - ("name" |=| Concepts.Value.String name) -end - -class type implementation = object - method resolve : string -> (Handle.t option, Concepts.Condition.condition) result - method cancelled : bool - method charge : int -> (unit, Concepts.Condition.condition) result - method nest : ?authority:string BatSet.t -> unit -> implementation -end - -(* Unlike every other protocol here, a context is handed to [Program.invoke] directly rather than - looked up through [Handle.into], exactly as evaluators.org's pseudocode shows. It therefore needs - no extensible-variant constructor and [make] is a plain upcast. *) -type t = implementation - -let make impl = (impl :> implementation) -let resolve context name = context#resolve name -let cancelled context = context#cancelled -let charge context n = context#charge n -let nest ?authority context = context#nest ?authority () |> make - -let require context name = - let open Utilities.Result in - let* found = resolve context name in - Option.to_result ~none:(Error.unresolved name) found diff --git a/lib/protocols/Context.mli b/lib/protocols/Context.mli deleted file mode 100644 index ec585cd..0000000 --- a/lib/protocols/Context.mli +++ /dev/null @@ -1,15 +0,0 @@ -type t - -class type implementation = object - method resolve : string -> (Handle.t option, Concepts.Condition.condition) result - method cancelled : bool - method charge : int -> (unit, Concepts.Condition.condition) result - method nest : ?authority:string BatSet.t -> unit -> implementation -end - -val make : #implementation -> t -val resolve : t -> string -> (Handle.t option, Concepts.Condition.condition) result -val require : t -> string -> (Handle.t, Concepts.Condition.condition) result -val cancelled : t -> bool -val charge : t -> int -> (unit, Concepts.Condition.condition) result -val nest : ?authority:string BatSet.t -> t -> t |
