diff options
author | Martin Odersky <odersky@gmail.com> | 2009-02-05 19:25:43 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-02-05 19:25:43 +0000 |
commit | 0ecacced0347e4e3b83989a274b9de53868a3a57 (patch) | |
tree | cf5bb351b3acef82ad88862bee320b9c6e32a4c3 /src/library/scalax/collection/generic/covariant | |
parent | 48355ee28a930f19000901d761f24ca44b324c1f (diff) | |
download | scala-0ecacced0347e4e3b83989a274b9de53868a3a57.tar.gz scala-0ecacced0347e4e3b83989a274b9de53868a3a57.tar.bz2 scala-0ecacced0347e4e3b83989a274b9de53868a3a57.zip |
added support for Strings, arrays, sets.
Diffstat (limited to 'src/library/scalax/collection/generic/covariant')
4 files changed, 12 insertions, 45 deletions
diff --git a/src/library/scalax/collection/generic/covariant/IterableTemplate.scala b/src/library/scalax/collection/generic/covariant/IterableTemplate.scala index ae9cd5e1d9..715f88cd8e 100755 --- a/src/library/scalax/collection/generic/covariant/IterableTemplate.scala +++ b/src/library/scalax/collection/generic/covariant/IterableTemplate.scala @@ -23,7 +23,17 @@ import annotation.unchecked.uncheckedVariance * @version 1.1, 04/02/2004 */ trait IterableTemplate[+CC[+B] <: IterableTemplate[CC, B] with Iterable[B], +A] - extends generic.IterableTemplate[CC, A @uncheckedVariance] { self /*: CC[A]*/ => } + extends generic.IterableTemplate[CC, A @uncheckedVariance] { self /*: CC[A]*/ => + +/* can't have a covariant view here, because mutable.Vector would + override it + override def view: IterableView[CC, A] = new IterableView[CC, A] { + val origin = thisCC + val elements: Iterator[A] = self.elements + } +*/ +} + // !!! todo: explain why @uncheckedVariance is justified here. diff --git a/src/library/scalax/collection/generic/covariant/IterableView.scala b/src/library/scalax/collection/generic/covariant/IterableView.scala deleted file mode 100755 index 728b065d55..0000000000 --- a/src/library/scalax/collection/generic/covariant/IterableView.scala +++ /dev/null @@ -1,21 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2009, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id: Iterable.scala 15188 2008-05-24 15:01:02Z stepancheg $ - -package scalax.collection.generic.covariant - -import annotation.unchecked.uncheckedVariance - -/** A non-strict projection of an iterable. - * @author Sean McDirmid - * @author Martin Odersky - * @note this should really be a virtual class of SequenceFactory - */ -trait IterableView[+UC[+B] <: Iterable[B], +A] - extends generic.IterableView[UC, A @uncheckedVariance] diff --git a/src/library/scalax/collection/generic/covariant/SequenceTemplate.scala b/src/library/scalax/collection/generic/covariant/SequenceTemplate.scala index 2e30e05fbf..1e8a416aec 100755 --- a/src/library/scalax/collection/generic/covariant/SequenceTemplate.scala +++ b/src/library/scalax/collection/generic/covariant/SequenceTemplate.scala @@ -14,4 +14,4 @@ package scalax.collection.generic.covariant import annotation.unchecked.uncheckedVariance trait SequenceTemplate[+CC[+B] <: SequenceTemplate[CC, B] with Sequence[B], +A] - extends generic.SequenceTemplate[CC, A @uncheckedVariance] {self /*: CC[A]*/ => } + extends generic.SequenceTemplate[CC, A @uncheckedVariance] diff --git a/src/library/scalax/collection/generic/covariant/SequenceView.scala b/src/library/scalax/collection/generic/covariant/SequenceView.scala deleted file mode 100755 index eba1795d13..0000000000 --- a/src/library/scalax/collection/generic/covariant/SequenceView.scala +++ /dev/null @@ -1,22 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2009, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id: Sequence.scala 16092 2008-09-12 10:37:06Z nielsen $ - - -package scalax.collection.generic.covariant - -import annotation.unchecked.uncheckedVariance - -/** A non-strict projection of an iterable. - * @author Sean McDirmid - * @author Martin Odersky - * @note this should really be a virtual class of SequenceFactory - */ -trait SequenceView[+UC[+B] <: Sequence[B], +A] - extends IterableView[UC, A] with generic.SequenceView[UC, A @uncheckedVariance] |