-
Notifications
You must be signed in to change notification settings - Fork 81
Description
I am trying to update my project to handle the new API changes (replacing objects with first class modules and variants), and I am having a little trouble understanding how to adapt the type 'a env convention described in the README, which is now outdated. I'm filing this ticket to put the README issue on your radar, but maybe this is also a good opportunity for me to learn how to use this properly.
The issue is that the release notes for 0.12 say that we can replace #foo with _ foo, but this does not work in type declarations. I ended up getting very confused about what it is I should put there, because I have to admit that I am not fully comfortable yet with OCaml's variants and how to control them, vis-a-vis subtyping, etc. What I ended up change my code to (which type-checked) was the following:
type 'a env = <
cwd : Eio.Fs.dir_ty Eio.Path.t;
process_mgr : [>] Eio.Process.mgr;
stdout : [>] Eio.Flow.sink;
..
> as 'a
Is this what you intend, or is there a better way to write this? I didn't actually know what [>] means. If this is the right way to write this code, then I can update the Eio README in a PR. thanks for your help and patience!