-
Notifications
You must be signed in to change notification settings - Fork 62
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
add requireSomeWith #303
base: master
Are you sure you want to change the base?
add requireSomeWith #303
Conversation
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.
Functions look good!
Just some nitpicks on keeping names the same.
Also would you mind adding doc comments and doc pages?
Thanks!
Co-authored-by: Jimmy Byrd <[email protected]>
Co-authored-by: Jimmy Byrd <[email protected]>
I can add the docs. Might take me a bit to make sure I'm careful with my copy-pasta'ing. |
Unintentionally closed |
@@ -124,6 +124,10 @@ module JobResult = | |||
option | |||
|> Job.map (Result.requireSome error) | |||
|
|||
let inline requireSomeWith ifErrorThunk option = |
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.
NIT: Doc comments
@@ -157,6 +157,13 @@ module AsyncResult = | |||
value | |||
|> Async.map (Result.requireSome error) | |||
|
|||
let inline requireSomeWith |
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.
NIT: Doc comments
@@ -109,6 +109,10 @@ module TaskResult = | |||
option | |||
|> Task.map (Result.requireSome error) | |||
|
|||
let inline requireSomeWith ifErrorThunk option = |
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.
NIT: Doc comments
Proposed Changes
Closes #301
This adds
requireSomeWith
helpers, analogous to thedefaultWith
ofOption
for types that already have arequireSome
function.Types of changes
What types of changes does your code introduce to FsToolkit.ErrorHandling?
Put an
x
in the boxes that apply and remove ones that don't applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
I've not yet added doc comments, as I saw some variability in coverage and not sure which is the up to date pattern to follow and how much should be documented.