Closed jonsterling closed 1 year ago
Yes, that's right. [>]
is the same as _
here (since it has to be a polymorphic variant), except that OCaml doesn't allow _
here for some reason (Error: A type wildcard "_" is not allowed in this type declaration.
).
In #614 I've used constraint
instead, which perhaps avoids the confusion.
cool, thanks so much for your help @talex5! At some point I may also have some other feedback and questions about the new API, but maybe I should take those to the Discourse board. Anyway, thanks again :)
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: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!