diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-09 23:53:15 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-09 23:55:18 -0300 |
| commit | 643513889d5cc1a06a267285d2eb208009babcb3 (patch) | |
| tree | 9b2ff96880eec49b68e4b02310c956f1726dabe8 /lib/protocols/Executable.ml | |
| parent | 254d106c92dcabcdeb83a5d0141deca22ffb79de (diff) | |
| download | RNT-643513889d5cc1a06a267285d2eb208009babcb3.tar.gz RNT-643513889d5cc1a06a267285d2eb208009babcb3.zip | |
programs as invokable images
Diffstat (limited to 'lib/protocols/Executable.ml')
| -rw-r--r-- | lib/protocols/Executable.ml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/protocols/Executable.ml b/lib/protocols/Executable.ml new file mode 100644 index 0000000..5dea52c --- /dev/null +++ b/lib/protocols/Executable.ml @@ -0,0 +1,12 @@ +class type implementation = object + method invoke : + Handle.t list -> within:Handle.t -> (Handle.t, Concepts.Condition.condition) result +end + +type Handle.protocol += Executable of implementation +type t = implementation + +let make impl = Executable (impl :> implementation) +let from handle = Handle.into handle (function Executable impl -> Some impl | _ -> None) +let require = Handle.require from +let invoke i inputs ~within = Handle.invoke i (fun o -> o#invoke inputs ~within) |
