(This might already be obvious to all involved, in which case let's make this a documentation issue.)
It is trivially easy to surface a submarine exception:
def foo[F[_]](implicit F: Concurrent[F]): F[Unit] = {
Handle.allowF[F, String] { handle =>
F.start(handle.raise("foo"))
}.rescue(_ => F.never).flatMap[Unit] { fib =>
F.widen(fib.joinWithNever)
}
}
The idea is that we can use the Handle in a completely different fiber, while allowF/rescue is lexical.
(This might already be obvious to all involved, in which case let's make this a documentation issue.)
It is trivially easy to surface a submarine exception:
The idea is that we can use the
Handlein a completely different fiber, whileallowF/rescueis lexical.