Skip to content

docs(option): fixes for several docstrings #68

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

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

glennsl
Copy link
Contributor

@glennsl glennsl commented Feb 23, 2023

I found the existing docstrings confusing, so I propose some simplifying changes.

@zth zth merged commit 2093988 into rescript-lang:main Feb 24, 2023
@@ -96,8 +96,7 @@ Option.getUnsafe(None) // Raises an error
external getUnsafe: option<'a> => 'a = "%identity"

/**
`mapWithDefault(opt, default, f)` applies `f` to `opt`, if `opt` is `None`, then
`f` return `default`, otherwise return that value applied with `f`.
`mapWithDefault(opt, default, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `default`.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be "... returns f(value)"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah it should be. Good catch! Fixed in #70

@glennsl glennsl deleted the docs/option/fixes branch February 24, 2023 08:31
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