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

Update result.gleam to clarify try and add examples of use #499

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

gavinmcgimpsey
Copy link
Contributor

I found result.try confusing when I had not realized that it could "replace" an Ok with an Error. I also did not understand its use in function chaining because I hadn't seen an example of a function call creating the result that it takes as input. This changes the description to be more precise about what result.try does, and to show examples of use that will hopefully demonstrate its value more clearly.

I found result.try confusing when I had not realized that it could "replace" an `Ok` with an `Error`. I also did not understand its use in function chaining because I hadn't seen an example of a function call creating the result that it takes as input. This changes the language to offer a more specific description of what result.try does, and to show examples of use that will hopefully demonstrate its value more clearly.
Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you.

Could you remove the examples that use non-existant functions please. In a future version of Gleam these will not compile.

@gavinmcgimpsey
Copy link
Contributor Author

Done!

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you!

@lpil lpil merged commit b3f6733 into gleam-lang:main Oct 19, 2023
1 check passed
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.

2 participants