-
-
Notifications
You must be signed in to change notification settings - Fork 65
Surfacing submarines #660
Copy link
Copy link
Open
Description
(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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels