cats-mtl icon indicating copy to clipboard operation
cats-mtl copied to clipboard

Add Handle#allow#attempt

Open iRevive opened this issue 2 months ago • 0 comments

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]

iRevive avatar Nov 07 '25 16:11 iRevive