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

Add a notice for simplification about Collection.someMethod #5

Open
exoego opened this issue Jul 4, 2019 · 1 comment
Open

Add a notice for simplification about Collection.someMethod #5

exoego opened this issue Jul 4, 2019 · 1 comment

Comments

@exoego
Copy link
Contributor

exoego commented Jul 4, 2019

There are some entries for methods defined in object like Collection.concat and Collection.empty.

I think it might be confusing for new-comers since there is no Collection object actually.
In reality, such methods are defined not inCollection but in the specific collection objects, e.g. List.concat or Set.empty.

I first imagined that each signatures have a note like

object COLLECTION {
  def empty[A]: COLLECTION[A]
}
// COLLECTION could be actual collection type, like List or Set.

but this is not ideal since the signatures requires translations.
So I would suggest to add

  • A dedicated page regarding this simplification somewhre.
  • Links to the page in the functions

For methods in trait, such simplification is fine, I think !!

@superruzafa
Copy link
Owner

I found using Collection object as the best way to express" the companion object of the trait Collection, where Collection means any class that behaves like that. It's complicated to keep the balance between being realistic and keeping things easy.

Anyway I agree with you that some kind of explanation need to be added.

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