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

Remove OneAnd? #2089

Open
ceedubs opened this issue Dec 10, 2017 · 1 comment
Open

Remove OneAnd? #2089

ceedubs opened this issue Dec 10, 2017 · 1 comment

Comments

@ceedubs
Copy link
Contributor

ceedubs commented Dec 10, 2017

OneAnd doesn't seem very useful to me now that Cats has first-class NonemptyList and NonemptyVector types. It can be awkward to work with, especially if you don't have type aliases and "companion" object set up for the type that you are working with.

It keeps its head element separate like a cons-list, making it not very efficient to use with a vector-like structure, but it combines by delegating to an Alternative instance, which isn't efficient for list-like structures.

People might reach for OneAnd when they want a non-empty version of a structure that doesn't have first-class non-empty support in Cats. Some common types that they might reach for are non-empty sets and non-empty maps. However, the OneAnd model doesn't actually work for those (see #1909 for an example).

I'm not sure that OneAnd cuts it as an abstraction, and I don't know anyone who is actually using it. I vote for removing it. Is there anyone who uses it and/or has reason for it to stay?

Here is a related gitter discussion.

@LukaJCB
Copy link
Member

LukaJCB commented Dec 10, 2017

I'm generally +1 on this, but would like to see a replacement for things like NonEmptyStream first :)

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

2 participants