Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Make ArrayOps not extend IndexedSeqOps #464

Closed
julienrf opened this issue Feb 19, 2018 · 3 comments
Closed

Make ArrayOps not extend IndexedSeqOps #464

julienrf opened this issue Feb 19, 2018 · 3 comments
Assignees
Labels

Comments

@julienrf
Copy link
Contributor

No description provided.

@julienrf julienrf added this to the 0.11.0 milestone Feb 19, 2018
@lrytz
Copy link
Member

lrytz commented Feb 21, 2018

So the goal here would be to get rid of unwanted inherited methods, such as the overload of map that works without a ClassTag. Example:

scala> val a = Array("a", "b").map(_.toUpperCase)
a: Array[String] = Array(A, B)

scala> val b = Array("a", "b").map(_.toUpperCase) : Iterable[String]
b: Iterable[String] = Vector(A, B)

scala> a : Iterable[String]
res16: Iterable[String] = WrappedArray(A, B)

But if ArrayOps no longer extends IterableOps, all the inherited operations that would work fine have to be re-implemented. There's no parent trait that would enforce the same interface - a problem that we already have between Iterator and IterableOps (#465).

@julienrf you looked at having parent traits that would group operations by their kind (reducing, transforming, self-transforming)? Is it out of the question?

@julienrf
Copy link
Contributor Author

I think we could probably have a parent trait for reducing operations, because unlike operations that return C or CC[?], there is no need for taking a type parameter (and thus no need to refine it at each level of the hierarchy).

@julienrf
Copy link
Contributor Author

julienrf commented Mar 1, 2018

Closed by #479.

@julienrf julienrf closed this as completed Mar 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants