Skip to content

Added combine and combine_with_all_errors helpers#5

Merged
kfly8 merged 2 commits intomainfrom
combinator
Apr 19, 2025
Merged

Added combine and combine_with_all_errors helpers#5
kfly8 merged 2 commits intomainfrom
combinator

Conversation

@kfly8
Copy link
Copy Markdown
Owner

@kfly8 kfly8 commented Apr 19, 2025

This pull request introduces two new utility functions, combine and combine_with_all_errors, to the Result::Simple module. These functions simplify handling multiple Result list by either aggregating successful results or collecting all errors. The changes include updates to the module's implementation, documentation, and tests.

New Features

  • Added the combine function to aggregate successful results from a list of Result list, returning the first error encountered if any.
  • Added the combine_with_all_errors function to collect all errors from a list of Result list, while still aggregating successful results if no errors occur.

Documentation

  • Updated README.md and the module's POD documentation to describe the usage, behavior, and examples of the new combine and combine_with_all_errors functions. [1] [2]

Exports

  • Updated the export list in lib/Result/Simple.pm to include combine and combine_with_all_errors.

Tests

  • Added comprehensive test cases for both combine and combine_with_all_errors to ensure correct behavior under various scenarios, including edge cases.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 14546957576

Details

  • 23 of 23 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 14546591261: 0.0%
Covered Lines: 129
Relevant Lines: 129

💛 - Coveralls

@kfly8 kfly8 merged commit 3d1bef5 into main Apr 19, 2025
14 checks passed
kfly8 added a commit that referenced this pull request Apr 19, 2025
Changelog diff is:

diff --git a/Changes b/Changes
index 72aa9ca..693bf60 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 Revision history for Perl extension Result-Simple
 
 {{$NEXT}}
+
+0.05 2025-04-19T23:07:50Z
     - Improve stactrace #4
     - [ENHANCEMENTS]
       - Added `combine` and `combine_with_all_errors`` helpers #5
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.

2 participants