Skip to content

Comments

Add Handle#allow#attempt#664

Open
iRevive wants to merge 1 commit intotypelevel:mainfrom
iRevive:topic/handle-attempt
Open

Add Handle#allow#attempt#664
iRevive wants to merge 1 commit intotypelevel:mainfrom
iRevive:topic/handle-attempt

Conversation

@iRevive
Copy link
Contributor

@iRevive iRevive commented Nov 7, 2025

I've started adopting submarine errors, and it would be nice to have a simple way to test an outcome.

The attempt combinator could be rather handy in tests:

for {
  r <- Handle.allow(fallible).attempt 
} yield assert(r == Left(SomeError)) // r = Either[E, A]

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.

1 participant