diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-08-22 23:22:31 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-08-23 03:07:00 +0000 |
| commit | 9ef2323823c8fea8cfb53e9c011433daeb7ec66f (patch) | |
| tree | 795874cc726b6daa0dd95da632c36d90e56f9b82 /lib/protocols | |
| parent | 339c9b0e30719e2e68310c90a1c9ef27f54c9d09 (diff) | |
| download | RNT-9ef2323823c8fea8cfb53e9c011433daeb7ec66f.tar.gz RNT-9ef2323823c8fea8cfb53e9c011433daeb7ec66f.zip | |
Make the interfaces open
Diffstat (limited to 'lib/protocols')
| -rw-r--r-- | lib/protocols/Directory.ml | 2 | ||||
| -rw-r--r-- | lib/protocols/Directory.mli | 2 | ||||
| -rw-r--r-- | lib/protocols/Handle.ml | 2 | ||||
| -rw-r--r-- | lib/protocols/Handle.mli | 2 | ||||
| -rw-r--r-- | lib/protocols/Registry.ml | 2 | ||||
| -rw-r--r-- | lib/protocols/Registry.mli | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/lib/protocols/Directory.ml b/lib/protocols/Directory.ml index 5a2637f..5b21668 100644 --- a/lib/protocols/Directory.ml +++ b/lib/protocols/Directory.ml @@ -7,7 +7,7 @@ type Handle.protocol += Directory of implementation type t = implementation -let make impl = Directory impl +let make impl = Directory (impl :> implementation) let from handle = Handle.into handle (function Directory impl -> Some impl | _ -> None) diff --git a/lib/protocols/Directory.mli b/lib/protocols/Directory.mli index b7bc69c..5bf5277 100644 --- a/lib/protocols/Directory.mli +++ b/lib/protocols/Directory.mli @@ -5,7 +5,7 @@ class type implementation = object method find : string -> Handle.t option end -val make : implementation -> Handle.protocol +val make : #implementation -> Handle.protocol val from : Handle.t -> t Handle.interface option diff --git a/lib/protocols/Handle.ml b/lib/protocols/Handle.ml index 1868737..9fd1f29 100644 --- a/lib/protocols/Handle.ml +++ b/lib/protocols/Handle.ml @@ -18,7 +18,7 @@ let object_of { valid; refers_to } = let interface_of handle interface = { handle; interface } -let make o = { valid = ref true; refers_to = o } +let make o = { valid = ref true; refers_to = (o :> obj) } let into handle f = List.find_map f (object_of handle)#protocols diff --git a/lib/protocols/Handle.mli b/lib/protocols/Handle.mli index 6fe175b..099f563 100644 --- a/lib/protocols/Handle.mli +++ b/lib/protocols/Handle.mli @@ -10,7 +10,7 @@ class type obj = object method protocols : protocol list end -val make : obj -> t +val make : #obj -> t val into : t -> (protocol -> 'a option) -> 'a interface option diff --git a/lib/protocols/Registry.ml b/lib/protocols/Registry.ml index 4e3a44e..4c47001 100644 --- a/lib/protocols/Registry.ml +++ b/lib/protocols/Registry.ml @@ -7,7 +7,7 @@ type Handle.protocol += Registry of implementation type t = implementation -let make impl = Registry impl +let make impl = Registry (impl :> implementation) let from handle = Handle.into handle (function Registry impl -> Some impl | _ -> None) diff --git a/lib/protocols/Registry.mli b/lib/protocols/Registry.mli index 855f8b8..175ebed 100644 --- a/lib/protocols/Registry.mli +++ b/lib/protocols/Registry.mli @@ -5,7 +5,7 @@ class type implementation = object method unregister : string -> (unit, Concepts.Condition.condition) result end -val make : implementation -> Handle.protocol +val make : #implementation -> Handle.protocol val from : Handle.t -> t Handle.interface option |
