Skip to content

Conversation

@myugen
Copy link
Collaborator

@myugen myugen commented May 14, 2025

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Support async operations through to new AsyncEither, a wrapper of Either to work with promises.

Added/updated tests?

We encourage you to keep the quality of the code by creating test.

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

@myugen myugen requested a review from Copilot May 14, 2025 11:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces asynchronous support by implementing a new AsyncEither class that enables running and composing async operations with Either semantics. It also exposes the FoldingEither type for external use and provides comprehensive tests and documentation updates for the new functionality.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/either/either.ts Exposes FoldingEither type to support asynchronous operations.
src/either/async-either.ts Implements AsyncEither with async map, flatMap, and fold methods.
src/either/async-either.test.ts Adds tests covering async functionality and error handling.
README.md Updates documentation to include sections on AsyncEither usage.

@myugen myugen merged commit 9baa192 into beta May 14, 2025
3 checks passed
@myugen myugen deleted the feat/support-asynchronous-monads branch May 14, 2025 11:09
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