-
Notifications
You must be signed in to change notification settings - Fork 465
Add Option.all* & Result.all* helpers #7181
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
Conversation
Ah I see this is basically rescript-lang/rescript-core#202 which I forgot to re-review, sorry about that! Build failed because of a code formatting issue.
|
This is called |
my rationale here is to keep it familiar by mimicking let (user, status) = await Promise.all2((getUser(id), getStatus(id)))
Result.all2((user, status)).map(((user, status)) => {
// ...
}) |
Yeah, I get it. Reproducing these kinds of design mistakes invites other issues though, such as confusion with |
And by the way we already have zip in Core.List. |
Yeah this implementation is looks like zip for sure.
|
runtime/Option.res
Outdated
|
||
let all = options => { | ||
let acc = [] | ||
let returnValue = ref(None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't that just be
let hasNone = ref(false)
instead? I would find that clearer.
BTW build failed because you need to check in the updated |
@bloodyowl Let's stay with |
@cknitt should be all good now! |
Thanks, merged! 🙂 |
No description provided.