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

Code example errors in guide on error handling #2243

Open
ChrisVine opened this issue Mar 18, 2024 · 0 comments
Open

Code example errors in guide on error handling #2243

ChrisVine opened this issue Mar 18, 2024 · 0 comments

Comments

@ChrisVine
Copy link

ChrisVine commented Mar 18, 2024

I have been reading the guide on error handling at Error Handling · OCaml Documentation.

Overall I thought there was good advice in the advice, but I noticed a couple of errors in the code example using the result type with the let* bind operator. The example passes a Yaml.value entity to Result.map_error instead of a (Yaml.value, [`Msg of string]) result entity ; and the function passed to Result.map_error is of type string -> string by partial application of Printf.sprintf instead of type [`Msg of string] -> ....

The second issue also appears in the equivalent example code which uses the binary >>= operator, but not the first issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant