Conversation
…n order to avoid any confusion
…eft, recover and match methods
BREAKING CHANGE: The Matchable object has been removed. Unwrap must be done using new fold API.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant updates to the
README.mddocumentation and theEithermonad implementation, along with minor adjustments to thepackage.jsonfile and test cases. The changes focus on improving the clarity and functionality of the monads, particularlyEither,Option, andTry, while replacing thematchmethod with more explicit methods likefold,onRight, andonLeft.Documentation Enhancements:
README.mdto include detailed examples of new methods (recover,fold,onRight,onLeft, etc.) forEither,Option, andTrymonads. These updates replace the previousmatchmethod with more descriptive alternatives. [1] [2] [3] [4]Trymonad creation methods (Try.success,Try.failure, andTry.execute) and added examples for retrieving values usinggetOrElseandgetOrThrow. [1] [2]Code Enhancements:
matchmethod withfoldand addedonRightandonLeftmethods to theEithermonad for handling side effects and unwrapping values. [1] [2]OptionandTrymonads with similarfoldand side-effect handling methods (onSome,onNone,onSuccess,onFailure). [1] [2]Testing Improvements:
onRight,onLeft, andrecovermethods for theEithermonad.matchmethod.Minor Adjustments:
package.jsonto correct thetypespath and updated contributor information. [1] [2]These changes improve the usability and readability of the library, making it easier for developers to work with monads in TypeScript.