-
Notifications
You must be signed in to change notification settings - Fork 542
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
Remove cats from core? #29
Comments
My main concern is that it's quite likely that further developments would make more use of Cats, which would then be forced into the Cats submodule. The net result would be that we would be back to where we are now but with dependencies on two modules rather than one and the additional complexity of attempting to split functionality across an arbitrary boundary. |
@milessabin Agreed. Here are some of the potential additional uses of cats that I've thought about:
So far none of these ideas seem like deal-breakers, but I'd be interested in collecting others. |
For the record there's additional conversation on this issue in the gitter room. |
echo @milessabin concern. I am not sure how useful can circe without cats module be? |
@ngbinh Many (most?) use cases wouldn't require the circe-cats module. See for example @vkostyukov's new example Finch + circe project here. It uses circe's Shapeless-powered codec derivation and (indirectly through finch-circe) circe-jawn, but it would look literally exactly the same if #28 gets merged. I think cats is fantastic (maybe that's obvious 😄), and I'm looking forward to adding a cats dependency to Finch, where it will allow us to clean up a lot of code. I just don't see the same kind of value in a cats dependency for circe-core. |
@travisbrown I see, thanks! |
My current thinking on this is that we move forward in this direction (cats in a module) as an experiment, but make it clear in the README that cats might be reintroduced into core at some point before 1.0 (or 0.5 or some other earlier cut-off if we think that would be better). Any objections? |
One other area where cats would be useful in core is for applicative decoding. I really like the support that Play JSON provides for accumulating errors, and it'd be a nice addition here, but it would be a lot more laborious without a |
@travisbrown I agree that accumulating errors would nice, and that it would be somehow painful to write without the help of cats. But what could be even nicer would be to be able to choose whether decoding should stop at first error (as it does currently, within the lines of argonaut) or collect all errors that can be. (This could even be done on a type-by-type basis, some stopping at first errors, and others collecting them all.) In the latter scenario, it feels to me that we would have to get our hands dirty anyway, and that cats would not be of much help here (just a beforehand intuition though...). |
The changes I talk about in my previous comment are a bit speculative for now. I don't mind putting the possible split of the core module (into core and cats modules) on hold for now, and the one you're talking about (error accumulation) being given a try. |
@alexarchambault I could imagine having My conference marathon ended last night, so I'll put together a pull request this morning and we can see if we think it justifies the dependency. |
We've finally merged error accumulation, only four months after my last comment promising it immediately. 😄 Given that this work depends heavily on |
update json4s 3.3.0.RC1
@alexarchambault has just submitted a pull request (#28) that removes cats from core and adds a new cats module that includes all of the original type class instances and operations that depended on cats.
This isn't terribly disruptive. Not having a right-biased disjunction is kind of annoying, but in my opinion not annoying enough to justify a dependency on its own. The
M
versions ofwithFocus
, etc. are nice to have, but aren't used in the core (or in many common use cases). I think I'd be okay with moving all of the cats type class instances to a subproject.I like the idea of a dependency-free core that just provides the encoding and decoding type classes, an Argonaut-flavored AST, and the zippers, and I'm tempted to go this route (especially now that @alexarchambault has done all the hard work). Is anyone strongly opposed?
The text was updated successfully, but these errors were encountered: