Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop the result compatibility package dependency #279

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

anmonteiro
Copy link
Contributor

  • even though the Result module was only added in OCaml 4.08:
    • the type {Pervasives,Stdlib}.result has been added as far back as OCaml 4.03
    • ppx_deriving's lower bound is OCaml 4.05, so it should be fine to remove this dependency

Copy link
Contributor

@sim642 sim642 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what this means #254 and #260.

Comment on lines 96 to 97
| true, ([%type: ([%t? ok_t], [%t? err_t]) result] |
[%type: ([%t? ok_t], [%t? err_t]) Result.result]) ->
[%type: ([%t? ok_t], [%t? err_t]) result]) ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two cases are now the same. Same in a bunch of other plugins.

But I wonder what implications this change has because this is a fully syntactic pattern. Code which previously derived explicitly for Result.result would no longer match here and fail to derive, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fair. I didn't catch this as it was mostly find / replace. I think it might probably be warranted to keep this case here, which is just matching on an ident Result.result. Since that doesn't re-introduce back the result dependency I think it should be reverted.

Copy link
Collaborator

@NathanReb NathanReb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! I'll fix @sim642 suggestion and merge if that's fine by you @anmonteiro.

@NathanReb NathanReb merged commit 94ae609 into ocaml-ppx:master Mar 28, 2024
1 check passed
NathanReb added a commit to NathanReb/opam-repository that referenced this pull request Apr 17, 2024
CHANGES:

* Fix the unintentional removal of `Ppx_deriving_runtime.Result` in ocaml-ppx/ppx_deriving#279
  ocaml-ppx/ppx_deriving#282
  (@NathanReb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants