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

Open
dimitriye98 opened this issue May 27, 2017 · 2 comments
Open

`AdditiveCollection` not defined for` Seq`? #725

dimitriye98 opened this issue May 27, 2017 · 2 comments

Comments

@dimitriye98
Copy link

@dimitriye98 dimitriye98 commented May 27, 2017

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 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

@dimitriye98 dimitriye98 commented May 29, 2017

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

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.