Skip to content

Added chain and pipeline helpers#3

Merged
kfly8 merged 1 commit intomainfrom
chain
Apr 18, 2025
Merged

Added chain and pipeline helpers#3
kfly8 merged 1 commit intomainfrom
chain

Conversation

@kfly8
Copy link
Copy Markdown
Owner

@kfly8 kfly8 commented Apr 18, 2025

This pull request introduces two new helper functions, chain and pipeline, to the Result::Simple library. These functions streamline handling of result types (T, E) in Perl, making it easier to perform sequential operations and validations. The changes include updates to the library's implementation, documentation, and test cases.

New Features

  • chain function: Added a helper function to pass result tuples (T, E) to the next function in a sequence. If an error exists, it halts further processing and returns the error. Otherwise, it applies the function and returns the updated result.
  • pipeline function: Added a helper function to create a composed pipeline of functions that process result tuples (T, E) sequentially. If any function in the pipeline returns an error, the pipeline halts immediately.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 14536668061

Details

  • 19 of 19 (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 14535516516: 0.0%
Covered Lines: 97
Relevant Lines: 97

💛 - Coveralls

@kfly8 kfly8 merged commit 748b5c1 into main Apr 18, 2025
14 checks passed
kfly8 added a commit that referenced this pull request Apr 18, 2025
Changelog diff is:

diff --git a/Changes b/Changes
index 48f3529..aab3655 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,15 @@ Revision history for Perl extension Result-Simple
 
 {{$NEXT}}
 
+0.04 2025-04-18T22:53:43Z
+    - [BREAKING CHANGES]
+        - Renamed `Ok` to `ok`, `Err` to `err` #2
+        - Removed `:Result` attribute, instead added `result_for` function #2
+        - Changed default value of `$ENV{RESULT_SIMPLE_CHECK_ENABLED}` to `1` #2
+    - [ENHANCEMENTS]
+        - Added `unsafe_unwrap` and `unsafe_unwrap_err` functions #2
+        - Added `chain` and `pipeline` helper functions #3
+
 0.03 2024-11-27T01:18:40Z
     - Improve docs #1
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