From 0635b1a3d8e2f3f18184d554b03f1e5614c0c5a9 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 26 Nov 2009 22:29:12 +0000 Subject: Following up on my deprecated method overreach. trunk contains all the deprecated methods it should. --- src/library/scala/Either.scala | 32 ---------------------- src/library/scala/collection/TraversableLike.scala | 9 ------ src/library/scala/collection/immutable/List.scala | 3 ++ 3 files changed, 3 insertions(+), 41 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/Either.scala b/src/library/scala/Either.scala index cc84685287..e456dab2dd 100644 --- a/src/library/scala/Either.scala +++ b/src/library/scala/Either.scala @@ -328,38 +328,6 @@ object Either { case Right(t) => t } - /** - * Returns the Left values in the given Iterable of Eithers. - */ - @deprecated("use `for (Left(a) <- es) yield a'") - def lefts[A, B](es: Iterable[Either[A, B]]) = - es.foldRight[List[A]](Nil)((e, as) => e match { - case Left(a) => a :: as - case Right(_) => as - }) - - /** - * Returns the Right values in the givenIterable of Eithers. - */ - @deprecated("use `for (Right(a) <- es) yield a'") - def rights[A, B](es: Iterable[Either[A, B]]) = - es.foldRight[List[B]](Nil)((e, bs) => e match { - case Left(_) => bs - case Right(b) => b :: bs - }) - - /** Transforms an Iterable of Eithers into a pair of lists. - * - * @param xs the iterable of Eithers to separate - * @return a pair of lists. - */ - @deprecated("use `for ((Left(l), Right(r)) <- es partition isLeft) yield (l, r)'") - def separate[A,B](es: Iterable[Either[A,B]]): (List[A], List[B]) = - es.foldRight[(List[A], List[B])]((Nil, Nil)) { - case (Left(a), (lefts, rights)) => (a :: lefts, rights) - case (Right(b), (lefts, rights)) => (lefts, b :: rights) - } - /** If the condition satisfies, return the given A in Left, * otherwise, return the given B in Right. */ diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala index b06eecc104..57ae2adabe 100644 --- a/src/library/scala/collection/TraversableLike.scala +++ b/src/library/scala/collection/TraversableLike.scala @@ -203,15 +203,6 @@ self => b.result } - /** Returns a traversable with all elements of this traversable which do not satisfy the predicate - * p. - * - * @param p the predicate used to test elements - * @return the traversable without all elements that satisfy p - */ - @deprecated("use `filterNot' instead") - def remove(p: A => Boolean): Repr = filterNot(p) - /** Partitions this traversable in two traversables according to a predicate. * * @param p the predicate on which to partition diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index 9aa27aae5f..4e29fb8f96 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -305,6 +305,9 @@ sealed abstract class List[+A] extends LinearSeq[A] @deprecated("use `span { x => !p(x) }` instead") def break(p: A => Boolean): (List[A], List[A]) = span { x => !p(x) } + @deprecated("use `filterNot' instead") + def remove(p: A => Boolean): List[A] = filterNot(p) + /** Computes the difference between this list and the given list * that. * -- cgit v1.2.3