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

AdditiveCollection not defined for Seq? #725

Closed
dimitriye98 opened this issue May 27, 2017 · 4 comments · Fixed by #1168
Closed

AdditiveCollection not defined for Seq? #725

dimitriye98 opened this issue May 27, 2017 · 4 comments · Fixed by #1168

Comments

@dimitriye98
Copy link

Why isn't AdditiveCollection defined for Seq itself? It makes it pretty much impossible to use sized Seqs, since all of the underlying methods require an AdditiveCollection type class.

@milessabin
Copy link
Owner

milessabin commented May 29, 2017

Seq only requires an ordering of it's elements, it doesn't require the additive behaviour that AdditiveCollection requires ... instances of the latter are defined ad hoc for concrete data types which do behave appropriately. Stream would be problematic, for instance. And there's nothing to stop someone from defining a Seq subtype with ordered-set-like behaviour.

@dimitriye98
Copy link
Author

Stream already has an applicable AdditiveCollection though? Stream is a LinearSeq, for which an AdditiveCollection conversion exists.

@jxnu-liguobin
Copy link
Contributor

It seems that this question can be used to get started? @joroKr21

@joroKr21
Copy link
Collaborator

It seems that this question can be used to get started? @joroKr21

Yes, @jxnu-liguobin sorry I missed your question 🙈 - do you want to work on this issue?
One would have to implement AdditiveCollection[Seq]. Do you have any questions?

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

Successfully merging a pull request may close this issue.

4 participants