Relax return types of Eio.Process.Pipe#775
Relax return types of Eio.Process.Pipe#775Arogbonlo wants to merge 2 commits intoocaml-multicore:mainfrom
Conversation
|
Hey @talex5 @patricoferris . |
patricoferris
left a comment
There was a problem hiding this comment.
Thanks @Arogbonlo !
I appreciate your efforts! |
talex5
left a comment
There was a problem hiding this comment.
This is good, but it also needs the same change for Eio_unix.pipe.
|
Ok. I'll get that done immediately! |
|
Hey @talex5 @patricoferris . |
talex5
left a comment
There was a problem hiding this comment.
You need to update eio_unix.mli with the more flexible types.
|
Hello @talex5 , Each time i update |
|
In the This union typing ([Unix_fd | Eio.Resource.close_ty | Eio.Flow.source_ty]forsource_ty) makes pipe’s output flexible enough to match what’s required in In So @talex5 , I think flexibility in |
|
The one in |
I just resolved that. I just uploaded the But after doing that, the build constantly fails. |
This PR relaxes the return types of the pipe function in Eio.Process to make the code more flexible. The main goal was to allow the pipe function to handle a broader range of types for input and output flows, while still maintaining compatibility with the rest of the codebase.
Changes:
Relaxed Type Definitions: I’ve updated the return types for pipe so they can accept any subtype of
Flow.source_tyandFlow.sink_ty. This will give us more flexibility when working with processes that require different types of flows.Polymorphic Variants: I used polymorphic variants (
[< .. ]) to allow for more flexible types, ensuring that the code still works with the broader variants expected in other parts of the system.Testing:
I ran dune runtest and confirmed that all tests are passing with these changes. The new types work fine, and the tests ensure everything is still functioning as expected.
This addresses issue #750, improving flexibility when working with various APIs that use stricter type definitions for sources and sinks.