diff options
author | Paul Phillips <paulp@improving.org> | 2009-11-26 22:09:33 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-11-26 22:09:33 +0000 |
commit | 3f03586ba49ae4a9d447af42001dad3f63f7ee52 (patch) | |
tree | 2d1a05f19ece92060905a2589d5b487c7a0dd4c7 | |
parent | 100112a580271b7408f11d06c187d6168f866160 (diff) | |
download | scala-3f03586ba49ae4a9d447af42001dad3f63f7ee52.tar.gz scala-3f03586ba49ae4a9d447af42001dad3f63f7ee52.tar.bz2 scala-3f03586ba49ae4a9d447af42001dad3f63f7ee52.zip |
Closes #2707.
-rw-r--r-- | src/library/scala/collection/immutable/List.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index 0c43620465..9aa27aae5f 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -299,6 +299,12 @@ sealed abstract class List[+A] extends LinearSeq[A] if (isEmpty) Stream.Empty else new Stream.Cons(head, tail.toStream) + + /** Like <code>span</code> but with the predicate inverted. + */ + @deprecated("use `span { x => !p(x) }` instead") + def break(p: A => Boolean): (List[A], List[A]) = span { x => !p(x) } + /** Computes the difference between this list and the given list * <code>that</code>. * |