typelevel / typelevel/cats-mtl
Surfacing submarines
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 307
- Forks
- 66
- Avg merge
- 6h 23m
- Merged PRs (30d)
- 2
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Handle.allowF and rescue usage shown in the issue, along with the Concurrent fiber behavior involved in F.start and joinWithNever. Determine whether the behavior is already expected; if so, document how a Handle can be used across fibers and how lexical rescue applies, and make the documentation accurately reflect the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100