-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fails to summon Applicative[ZIO[Any, E, *]] #185
Comments
Seems the issue is related to importing both It's not obvious that this would cause double import issues, and it does not help that IMO this should be fixed so importing |
I'm afraid this is impossible (while keeping them in separate objects) because wildcard imports put everything in high priority scope. If we put them all into one object, prioritization via traits would work - but it may be non-trivial to ensure that this big object is compiled in such a way that missing Optional dependencies won't break it. We can also do that by mixing in new traits to create specificity, e.g. trait LessSpecific
trait MoreSpecific extends LessSpecific
// in catz extend everything with MoreSpecific
// in catz.core extend everything with LessSpecific Obviously all of these solutions are unobvious, but may be worth it to increase UX. @ghostdogpr thoughts? |
OTOH importing both |
Is there a case where you'd ever want to import just |
@heksesang Yeah, the original use case was when you only depend on |
Best would be to have one import that could ensure that it didn't rely on For example now, I have some code that compiles fine with either If there weren't two imports, but I don't know how easy (or hard) it would be to implement it that way, but the user experience would be better for it I think. :) |
@heksesang |
As seen in the Scastie below, the compiler fails to summon an instance of
Applicative
forZIO[Any, E, *]
, while it can do it forZIO[Any, Throwable, *]
:https://scastie.scala-lang.org/jKTDL41xRp6XgCBhhJsbxw
Think it's related to the
ArrowChoice
instances that are used to derive theApplicative
, but it should be possible to provide anApplicative
for that out of the box, considering how easy just writing it by hand is. ;)The text was updated successfully, but these errors were encountered: