Skip to content
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

Separate interop with cats-core #94

Closed
laurynaslubys opened this issue Oct 20, 2019 · 5 comments
Closed

Separate interop with cats-core #94

laurynaslubys opened this issue Oct 20, 2019 · 5 comments

Comments

@laurynaslubys
Copy link

Hi,

I think it would it make sense to have a separate package for interop only with cats-core (excluding cats-effect). That way if I am only using cats-core for functional goodness, I wouldn't need to bring in cats-effect as a transitive dependency into my build.

Thoughts?

@ghostdogpr
Copy link
Member

Actually the cats-effect library is marked as Optional in sbt, which means you won't get it unless you explicitly add it (or have it from another library) => https://github.com/zio/interop-cats/blob/master/build.sbt

@ghostdogpr
Copy link
Member

Ah, but this file is mixing both so if you only need e.g. Monad it might require everything

@neko-kai what do you think?

@neko-kai
Copy link
Member

neko-kai commented Oct 20, 2019

@laurynasl-wix @ghostdogpr
I guess it shouldn't be Optional because you'll get linking failures trying to use implicits from the catz object without CE on the classpath.
But, the way it's structured right now it's possible to add a object core extends CatsInstances2 and if you import that object instead it will work. @laurynasl-wix Could you try to make that object and see if it works for you?

tbh, ideally I'd like to get rid of the catz object completely and put the instances into ZIO companion, using one or another version of Optional instances trick. The second one would be ideal, but I couldn't get it to work with Scala 2 without abusing sbt's evictions - unlike Dotty, Scala 2 does not tolerate undefined types in generic parameter of superclass during implicit search.

neko-kai added a commit to 7mind/interop-cats that referenced this issue Oct 20, 2019
…s-core, not cats-effect

- also update README.md
@neko-kai
Copy link
Member

@laurynaslubys
Copy link
Author

Nice, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants