typelevel / cats

Lightweight, modular, and extensible library for functional programming.
https://typelevel.org/cats/
Other
5.25k stars 1.21k forks source link

Given MonadError[F, Z], EitherT[F, E, ?] should provide a MonadError[..., Either[Z, E]] #2261

Open oleg-py opened 6 years ago

oleg-py commented 6 years ago

The title says it all, basically.

It's a known fact that something like EitherT[IO, E, ?] has two channels of failing: by raising the Throwable in IO and by raising a E in an inner Either. Instead of prioritizing the former, I suggest we expose the ability to work with both channels of failure directly by using a coproduct type.

Same applies to OptionT[F, A]

barambani commented 6 years ago

I can give a look if that's ok, this is still in discussion may be ? Ignore then.