-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to cats-effect 3 and scala 3 #416
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey @vlovgr, any problems with the migration, or is this just waiting for a stable release? asking for typelevel/cats-effect#1330 :) |
No issues, should hopefully have a milestone release out soon. :) |
Cool :) |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The biggest change for cats-effect 3 is that
ConfigValue[A]
has becomeConfigValue[+F[_], A]
. We've introduced theEffect
type forConfigValue[Effect, A]
to indicate a value which is written in an effect-polymorphic fashion using the cats-effect type classes (and so can be used with any effect type implementingAsync
). This was a necessary change due to the cats-effect 2Effect
type being removed, while still supportingeval
,evalMap
, andresource
.Note the above change still means we can preserve the syntax of v1.x, and the effect type does not have to be specified explicitly in most cases (compared to v0.x when it had to specified explicitly everywhere). In some cases, particularly where explicit type annotations are used,
ConfigValue[A]
will have to be changed toConfigValue[Effect, A]
, or some other effect type replacingEffect
. We can also useConfigValue#covary
to explicitly specify the effect type.Finally, when using parallel composition (e.g.
parMapN
orparTupled
), values are loaded in parallel. This was an oversight raised by @zarthross in #398 and which require no additional type class constraints in cats-effect 3.Detailed changes:
cats-effect-kernel
.ConfigValue[A]
toConfigValue[+F[_], A]
.Effect
for indicating aConfigValue[Effect, A]
can be used with any effect type.ConfigValue#load
,attempt
, andresource
to no longer requireContextShift
.ConfigValue#covary
for explicitly specifying the effect type.ConfigValue.blockOn
withConfigValue.blocking
.ConfigValue#parFlatMap
.file
to no longer require aBlocker
instance.ConfigValue.default
to be strict (rather than lazy) in it's parameter.parMapN
andparTupled
). Supercedes Work in Progress: Concurrent Parallel #398.WeakTypeTag
usage in the enumeratum and refined modules with TypeName.ConfigException
to be acase class
.