Skip to content

Conversation

@tw0po1nt
Copy link
Contributor

@tw0po1nt tw0po1nt commented May 9, 2025

Proposed Changes

Add a couple of simple but useful helper functions to modules with the Result type in their stack

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 apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

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.

  • Build and tests pass locally
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

@TheAngryByrd
Copy link
Collaborator

cc @1eyewonder

Copy link
Contributor

@1eyewonder 1eyewonder left a comment

Choose a reason for hiding this comment

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

Overall looks good! Maybe we also want to add ok to the ResultOption as well. Here an old PR that came to mind when looking at this for context #287

)
input

let inline ok x =
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: maybe we want to start adding some xml doc comments to these functions with the links to where they will be found like what we have been adding recently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can do that. I didn't here because the others didn't and I wondered if it wasn't because the function is so simple

@tw0po1nt
Copy link
Contributor Author

tw0po1nt commented May 15, 2025

My thought process for this was that modules with Result as the outer effect of the stack could just use the Result DU cases directly. But if you think otherwise, it's simple enough to add them and I'll gladly do that

@1eyewonder
Copy link
Contributor

Nope, that actually makes perfect sense. I'm ok leaving it out. One less thing we have to maintain 😄

@TheAngryByrd TheAngryByrd merged commit 66a2757 into demystifyfp:master May 20, 2025
27 checks passed
TheAngryByrd added a commit that referenced this pull request May 29, 2025
- BREAKING: [Remove Ply and update to FSharp 6](#248) Credits @TheAngryByrd
- BREAKING: [Remove MergeSources (and!) from some implementations like Result](#261)  Credits @TheAngryByrd
- BREAKING: [Merge TaskResult into Core library](#285) Credits @TheAngryByrd
- This means FsToolkit.ErrorHandling.TaskResult is no longer a separate package and will not be updated. It is now part of the core library.
- BREAKING: [Rename retn to singleton](#287) Credits @1eyewonder
- BREAKING: [Rename returnError to error + documentation](#311) Credits @tw0po1nt
- [Use Microsoft.Bcl.AsyncInterfaces in netstandard2.0 (Allows IAsyncDisposable and IAsyncEnumerable)](#250) Credits @TheAngryByrd
- [Build against Net8](#251) Credits @TheAngryByrd
- [Fix Overload Resolution to Align to Computation Expression used](#252) Credits @TheAngryByrd
- [refactor!: Seq.sequenceResultM returns Array instead of seq](#255) Credits @bartelink
- [feat(Seq): sequenceResultA](#255) Credits @bartelink
- [Updated uses of Seq.append](#290) Credits @1eyewonder
- [Add Option.traverseAsync and Option.sequenceAsync](#298 (comment)) Credits @tw0po1nt
- [Add Require and Check helper methods](#295) Credits @PI-Gorbo
- [Add new AsyncOption APIs and document all its other functions; minor fixes to documentation for Option module](#307) Credits @tw0po1nt
- [F# 9 support and nullness](#308) Credits @TheAngryByrd
- [Update IcedTasks 0.11.7](0a4cc7b) Credits @TheAngryByrd
- [Add TaskValidation module](#313) Credits @tw0po1nt
- [feat(Seq.traverse/sequence*)!: Yield arrays](#310) Credits @bartelink
- [Add ParallelAsync CEs](#318) Credits @njlr
- [Add Option.sequenceAsyncResult and Option.traverseAsyncResult](#321) Credits @JayWearsSocks
- [Add traversals/sequences for Task and TaskResult in the Option module](#325) Credits @tw0po1nt
- [Add ok and error helper functions to TaskResultOption and AsyncResultOption modules](#327) Credits @tw0po1nt
- [Add CancellableTaskOption module and CE + tests and documentation](#328) Credits @tw0po1nt
TheAngryByrd added a commit that referenced this pull request Jun 2, 2025
- BREAKING: [Remove Ply and update to FSharp 6](#248) Credits @TheAngryByrd
- BREAKING: [Remove MergeSources (and!) from some implementations like Result](#261)  Credits @TheAngryByrd
- BREAKING: [Merge TaskResult into Core library](#285) Credits @TheAngryByrd
- This means FsToolkit.ErrorHandling.TaskResult is no longer a separate package and will not be updated. It is now part of the core library.
- BREAKING: [Rename retn to singleton](#287) Credits @1eyewonder
- BREAKING: [Rename returnError to error + documentation](#311) Credits @tw0po1nt
- [Use Microsoft.Bcl.AsyncInterfaces in netstandard2.0 (Allows IAsyncDisposable and IAsyncEnumerable)](#250) Credits @TheAngryByrd
- [Build against Net8](#251) Credits @TheAngryByrd
- [Fix Overload Resolution to Align to Computation Expression used](#252) Credits @TheAngryByrd
- [refactor!: Seq.sequenceResultM returns Array instead of seq](#255) Credits @bartelink
- [feat(Seq): sequenceResultA](#255) Credits @bartelink
- [Updated uses of Seq.append](#290) Credits @1eyewonder
- [Add Option.traverseAsync and Option.sequenceAsync](#298 (comment)) Credits @tw0po1nt
- [Add Require and Check helper methods](#295) Credits @PI-Gorbo
- [Add new AsyncOption APIs and document all its other functions; minor fixes to documentation for Option module](#307) Credits @tw0po1nt
- [F# 9 support and nullness](#308) Credits @TheAngryByrd
- [Update IcedTasks 0.11.7](0a4cc7b) Credits @TheAngryByrd
- [Add TaskValidation module](#313) Credits @tw0po1nt
- [feat(Seq.traverse/sequence*)!: Yield arrays](#310) Credits @bartelink
- [Add ParallelAsync CEs](#318) Credits @njlr
- [Add Option.sequenceAsyncResult and Option.traverseAsyncResult](#321) Credits @JayWearsSocks
- [Add traversals/sequences for Task and TaskResult in the Option module](#325) Credits @tw0po1nt
- [Add ok and error helper functions to TaskResultOption and AsyncResultOption modules](#327) Credits @tw0po1nt
- [Add CancellableTaskOption module and CE + tests and documentation](#328) Credits @tw0po1nt
- [Remove paket, Enforce nullness on net9.0, remove mocha](#331) Credits @TheAngryByrd
- [Add TaskValueOption module, operators, and CE + tests and documentation](#329) Credits @tw0po1nt
TheAngryByrd added a commit that referenced this pull request Jun 2, 2025
- BREAKING: [Remove Ply and update to FSharp 6](#248) Credits @TheAngryByrd
- BREAKING: [Remove MergeSources (and!) from some implementations like Result](#261)  Credits @TheAngryByrd
- BREAKING: [Merge TaskResult into Core library](#285) Credits @TheAngryByrd
- This means FsToolkit.ErrorHandling.TaskResult is no longer a separate package and will not be updated. It is now part of the core library.
- BREAKING: [Rename retn to singleton](#287) Credits @1eyewonder
- BREAKING: [Rename returnError to error + documentation](#311) Credits @tw0po1nt
- [Use Microsoft.Bcl.AsyncInterfaces in netstandard2.0 (Allows IAsyncDisposable and IAsyncEnumerable)](#250) Credits @TheAngryByrd
- [Build against Net8](#251) Credits @TheAngryByrd
- [Fix Overload Resolution to Align to Computation Expression used](#252) Credits @TheAngryByrd
- [refactor!: Seq.sequenceResultM returns Array instead of seq](#255) Credits @bartelink
- [feat(Seq): sequenceResultA](#255) Credits @bartelink
- [Updated uses of Seq.append](#290) Credits @1eyewonder
- [Add Option.traverseAsync and Option.sequenceAsync](#298 (comment)) Credits @tw0po1nt
- [Add Require and Check helper methods](#295) Credits @PI-Gorbo
- [Add new AsyncOption APIs and document all its other functions; minor fixes to documentation for Option module](#307) Credits @tw0po1nt
- [F# 9 support and nullness](#308) Credits @TheAngryByrd
- [Update IcedTasks 0.11.7](0a4cc7b) Credits @TheAngryByrd
- [Add TaskValidation module](#313) Credits @tw0po1nt
- [feat(Seq.traverse/sequence*)!: Yield arrays](#310) Credits @bartelink
- [Add ParallelAsync CEs](#318) Credits @njlr
- [Add Option.sequenceAsyncResult and Option.traverseAsyncResult](#321) Credits @JayWearsSocks
- [Add traversals/sequences for Task and TaskResult in the Option module](#325) Credits @tw0po1nt
- [Add ok and error helper functions to TaskResultOption and AsyncResultOption modules](#327) Credits @tw0po1nt
- [Add CancellableTaskOption module and CE + tests and documentation](#328) Credits @tw0po1nt
- [Remove paket, Enforce nullness on net9.0, remove mocha](#331) Credits @TheAngryByrd
- [Add TaskValueOption module, operators, and CE + tests and documentation](#329) Credits @tw0po1nt
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