-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
No typeclasses for Seq #1222
Comments
Thanks for bringing this up, @aebrett. This is a question that comes up every once in a while on Gitter, but it looks like we currently don't have an explanation of this in the docs anywhere (such as in the FAQ). The short answer is that In general, I think that when you are trying to abstract over collections, it's better to do something like Having said all of that, |
While I agree that It is unfortunate that I don't see how. Can you demonstrate a failure case? I also think we do more service to users by giving them these instances rather than tell them to go add yet another dependency. |
@johnynek I think it depends on what your definition of equality is for the laws. For example, the functor laws say that I should be able to freely replace Also, are we referring to I keep swinging back and forth on this sort of thing. On the one hand, I don't want to automatically throw stuff that might cause issues for someone into their implicit scope when they |
"On the other hand, I think that people probably generally know that if they mutate objects then that will affect the results that they get." I agree with this. In my view, we should show a problem using best practices. If we have to use exceptions, nulls, casting, or mutation to show an issue, in my mind, that is mostly showing the danger of those practices and not reason to avoid support in cats. So, to my way of thinking, if you pass a mutable That said, I have never needed these types for |
Another issue with I personally couldn't care less about the issues related to the fact that |
FFW I have to work with a lot of tree structures containing Seqs. Turning these into lists or vectors manually all the time gets annoying soon (barring defining an implicit conversion). |
Why not just provide the instances for |
FWIW, I don't see anything unlawful about implementing instances for |
I was wondering is the new collections from 2.13 changing anything? |
Imo |
I think there's no real principled reason to leave out |
Just adding that this (only having instances for List and Vector for for instance, |
Just got bitten again with a It's becoming a show stopper for beginners and I'm questioning if we should reduce our use of cats because even if I'm able to deal with this issue new comers to our codebase and Scala are starting to think Scala is a pain to use. |
Damn! Finally! |
I see there are typeclasses under cats.std for List and Vector (among others), but none for Seq. Is there a reason no typeclasses for Seq are provided? If it's simply that there's been no demand previously, then I'm happy to raise a PR to add this.
The text was updated successfully, but these errors were encountered: