diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2012-09-25 14:06:29 -0400 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2012-09-25 14:06:59 -0400 |
commit | 0263e725045ee6404b8f523db0e8be1b09ab0ec9 (patch) | |
tree | dcb28d856ea4bd6e7db1b2af12582633bff0b009 /src/library/scala/collection/immutable/Stream.scala | |
parent | f284ac55c931249a49499a7831de4d25213d34b8 (diff) | |
download | scala-0263e725045ee6404b8f523db0e8be1b09ab0ec9.tar.gz scala-0263e725045ee6404b8f523db0e8be1b09ab0ec9.tar.bz2 scala-0263e725045ee6404b8f523db0e8be1b09ab0ec9.zip |
Improves SI-6409 - Add note to string flatMap about evaluation.
Note: flatMap has to evaluate the stream until it finds
a head for the new stream. This is a limitation that will
exist for 2.10.0, but the bug will remain open.
Diffstat (limited to 'src/library/scala/collection/immutable/Stream.scala')
-rw-r--r-- | src/library/scala/collection/immutable/Stream.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala index bac90341ec..461a375317 100644 --- a/src/library/scala/collection/immutable/Stream.scala +++ b/src/library/scala/collection/immutable/Stream.scala @@ -422,6 +422,9 @@ self => * // produces: 10, 10, 11, 10, 11, 11, 10, 11, 11, 12, 10, 11, 11, 12, 13 * }}} * + * ''Note:'' Currently `flatMap` will evaluate as much of the Stream as needed + * until it finds a non-empty element for the head, which is non-lazy. + * * @tparam B The element type of the returned collection '''That'''. * @param f the function to apply on each element. * @return `f(a,,0,,) ::: ... ::: f(a,,n,,)` if |