Skip to content

Conversation

@tech-andgar
Copy link

Add a new method that returns a record with success and error values for destructuring.
Include documentation and tests for the new functionality.

Add a new method that returns a record with success and error values for destructuring.
Include documentation and tests for the new functionality.
Add `getBoth` method for record destructuring
Add `getBoth` method for record destructuring
@wellgenio
Copy link

wellgenio commented Nov 11, 2025

beautiful ❤️

@tech-andgar

unwrap would be a better name.
failure to maintain consistency in nomenclature.

final (:success, :failure) = result.unwrap();

@tech-andgar
Copy link
Author

@wellgenio Thanks for the feedback!

I would prefer to avoid unwrap. In many ecosystems (like Rust or Swift), unwrap implies "get the value or crash/throw."

Since this method is safe and simply splits the result, I suggest unpack (or toRecord). It describes the action of destructuring without implying the risk of a runtime exception.

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