diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-09-17 03:36:30 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-09-17 03:36:40 +0000 |
| commit | 24bb5eab738e291ee170f4fd563f39e33f65f37d (patch) | |
| tree | 701a4a30a42b1cb06e7ef126c41b7cc61315873d /lib/protocols | |
| parent | 272ac23caa835faede38156699b40f884ad2ed11 (diff) | |
| download | RNT-24bb5eab738e291ee170f4fd563f39e33f65f37d.tar.gz RNT-24bb5eab738e291ee170f4fd563f39e33f65f37d.zip | |
WIP forsake context
Diffstat (limited to '')
| -rw-r--r-- | lib/protocols/Enumerable.ml | 4 | ||||
| -rw-r--r-- | lib/protocols/Enumerable.mli | 5 | ||||
| -rw-r--r-- | lib/protocols/Program.ml | 7 | ||||
| -rw-r--r-- | lib/protocols/Program.mli | 11 |
4 files changed, 8 insertions, 19 deletions
diff --git a/lib/protocols/Enumerable.ml b/lib/protocols/Enumerable.ml index e78f265..53db834 100644 --- a/lib/protocols/Enumerable.ml +++ b/lib/protocols/Enumerable.ml @@ -9,7 +9,7 @@ module Error = struct end class type implementation = object - method enumerate : Context.t -> (Handle.t, Concepts.Condition.condition) result + method enumerate : (Handle.t, Concepts.Condition.condition) result end type Handle.protocol += Enumerable of implementation @@ -18,4 +18,4 @@ type t = implementation let make impl = Enumerable (impl :> implementation) let from handle = Handle.into handle (function Enumerable impl -> Some impl | _ -> None) let require handle = from handle |> Option.to_result ~none:(Error.not_enumerable ()) -let enumerate i context = Handle.invoke i (fun o -> o#enumerate context) +let enumerate i = Handle.invoke i (fun o -> o#enumerate) diff --git a/lib/protocols/Enumerable.mli b/lib/protocols/Enumerable.mli index 4a903f6..d2ab882 100644 --- a/lib/protocols/Enumerable.mli +++ b/lib/protocols/Enumerable.mli @@ -1,7 +1,7 @@ type t class type implementation = object - method enumerate : Context.t -> (Handle.t, Concepts.Condition.condition) result + method enumerate : (Handle.t, Concepts.Condition.condition) result end val make : #implementation -> Handle.protocol @@ -9,5 +9,4 @@ val from : Handle.t -> t Handle.interface option val require : Handle.t -> (t Handle.interface, Concepts.Condition.condition) result -val enumerate : - t Handle.interface -> Context.t -> (Handle.t, Concepts.Condition.condition) result +val enumerate : t Handle.interface -> (Handle.t, Concepts.Condition.condition) result diff --git a/lib/protocols/Program.ml b/lib/protocols/Program.ml index 49e6e2d..5b618e6 100644 --- a/lib/protocols/Program.ml +++ b/lib/protocols/Program.ml @@ -4,10 +4,7 @@ end module Make (P : PROGRAM) = struct class type implementation = object - method invoke : - program:P.t -> - Context.t -> - (Handle.t, Concepts.Condition.condition) result + method invoke : P.t -> (Handle.t, Concepts.Condition.condition) result end type Handle.protocol += Program of implementation @@ -16,5 +13,5 @@ module Make (P : PROGRAM) = struct let make impl = Program (impl :> implementation) let from handle = Handle.into handle (function Program impl -> Some impl | _ -> None) - let invoke i ~program ctx = Handle.invoke i (fun o -> o#invoke ~program ctx) + let invoke i program = Handle.invoke i (fun o -> o#invoke program) end diff --git a/lib/protocols/Program.mli b/lib/protocols/Program.mli index 1d6c3ae..9cf4455 100644 --- a/lib/protocols/Program.mli +++ b/lib/protocols/Program.mli @@ -6,18 +6,11 @@ module Make (P : PROGRAM) : sig type t class type implementation = object - method invoke : - program:P.t -> - Context.t -> - (Handle.t, Concepts.Condition.condition) result + method invoke : P.t -> (Handle.t, Concepts.Condition.condition) result end val make : #implementation -> Handle.protocol val from : Handle.t -> t Handle.interface option - val invoke : - t Handle.interface -> - program:P.t -> - Context.t -> - (Handle.t, Concepts.Condition.condition) result + val invoke : t Handle.interface -> P.t -> (Handle.t, Concepts.Condition.condition) result end |
