Skip to content

IO.onError is inconsistent with ApplicativeError #4058

@Jasper-M

Description

@Jasper-M

The onError that you get from ApplicativeError has this signature:

def onError[A](fa: F[A])(pf: PartialFunction[E, F[Unit]]): F[A]

While the "native" one in IO doesn't take a PartialFunction:

def onError(f: Throwable => IO[Unit]): IO[A]

That could lead to some surprises if you would rewrite a piece of code from tagless final to IO, or if you are just used to using the onError extension method in other code.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions