Skip to content

update option.md with small tweaks and additional examples #2986

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jakubsvec001
Copy link
Contributor

@jakubsvec001 jakubsvec001 commented Feb 26, 2025

This is 1 of 2 pull requests on the option.md tutorial.

I broke these into two parts. I don't intend for part 2's suggestions to be pulled into the repo since they are currently in a separate file for your consideration. There is probably a better way for me to structure such a pair of pull requests such that they can be considered separately and am open to suggestions for the future. My priority was to keep them from stepping on each other during a potential merge.

Part 1:
Part one has some minor tweaks and additional examples. This includes an updated "## Conclusion" to be more encompassing of the lesson as a whole. The deleted "## Conclusion" is included in part 2.

Part 2:
Part two is an extrapolation on the Option.bind implementation example using Option.map and Option.join. I found this example fun to consider but thought it warranted a longer treatment since it is not immediately clear how Option.map and Option.join chain together.
Part 2 can be found here: #2987

@jakubsvec001
Copy link
Contributor Author

@cuihtlauac

I updated this lesson with an implementation of Option.bind using map and join.

It has mentioned here, there is a short presentation of bind and an shortened implementation of bind using map and join. It also includes a side note about how bind and join can be used to construct monads.

In general, I added a few examples to several of the functions covered in this lesson. If you wish wish for me to shorten any of it, let me know and I'll remove less informative examples.

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

Successfully merging this pull request may close these issues.

2 participants