typelevel / typelevel/cats-effect
Replace non-`Gen` kernel variants with existential form
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 576
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 18
Description
Right now, Concurrent[F[_]] = GenConcurrent[F, Throwable]. This matches our general opinion of the most common use-case, but there's a second extremely common scenario that we currently don't offer the same convenience around: Concurrent[F, _]. This is to say, the scenario in which you want concurrency but you don't care about the error handling. Arguably, this is even more common than the Throwable case.
Thinking through possible alias names here, it occurred to me that even Concurrent is actually quite inconsistent with the MonadThrow and MonadCancelThrow convention. In my opinion, an ideal configuration would be the following:
type Concurrent[F[_]] = GenConcurrent[F, _]
type ConcurrentThrow[F[_]] = GenConcurrent[F, Throwable]
This would also subtly encourage people to default to parametrically ignoring errors whenever possible, and would in turn make the types in downstream declaration sites a lot more helpful.
The fun thing is that we could actually do this in a fully binary compatible fashion! It would, however, break a lot of source code if we just did it blindly, so we would probably want to scalafix the change and encourage people to manually inspect the results.
Opinions wanted.
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
Use the issue text as the starting point and locate the existing Concurrent and GenConcurrent type aliases in the cats-effect sources. Review the proposed Concurrent and ConcurrentThrow forms, then investigate the source-compatibility impact and the possible Scalafix migration. Done means the design is settled and the compatibility and migration path are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100