summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/immutable/Stream.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-06-24 15:19:05 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-06-24 18:10:42 +1000
commit1f7417c763fb199cacc6afedc6e54796916fd673 (patch)
treebd00d7e0e47be310172f01c758c01ca5430063c4 /src/library/scala/collection/immutable/Stream.scala
parent73f40564a6b19e8b15f0908c3e24f1a8fe405605 (diff)
parent1b09e12ef3b3fea1cab56bac893295f74de23b8b (diff)
downloadscala-1f7417c763fb199cacc6afedc6e54796916fd673.tar.gz
scala-1f7417c763fb199cacc6afedc6e54796916fd673.tar.bz2
scala-1f7417c763fb199cacc6afedc6e54796916fd673.zip
Merge branch '2.11.x' into merge/2.11.x-to-2.12.x-20150624
Diffstat (limited to 'src/library/scala/collection/immutable/Stream.scala')
-rw-r--r--src/library/scala/collection/immutable/Stream.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala
index ada3533a60..6c5b10e73b 100644
--- a/src/library/scala/collection/immutable/Stream.scala
+++ b/src/library/scala/collection/immutable/Stream.scala
@@ -153,7 +153,7 @@ import scala.language.implicitConversions
*
* - The fact that `tail` works at all is of interest. In the definition of
* `fibs` we have an initial `(0, 1, Stream(...))` so `tail` is deterministic.
- * If we deinfed `fibs` such that only `0` were concretely known then the act
+ * If we defined `fibs` such that only `0` were concretely known then the act
* of determining `tail` would require the evaluation of `tail` which would
* cause an infinite recursion and stack overflow. If we define a definition
* where the tail is not initially computable then we're going to have an
@@ -1134,7 +1134,13 @@ object Stream extends SeqFactory[Stream] {
* to streams.
*/
class ConsWrapper[A](tl: => Stream[A]) {
+ /** Construct a stream consisting of a given first element followed by elements
+ * from a lazily evaluated Stream.
+ */
def #::(hd: A): Stream[A] = cons(hd, tl)
+ /** Construct a stream consisting of the concatenation of the given stream and
+ * a lazily evaluated Stream.
+ */
def #:::(prefix: Stream[A]): Stream[A] = prefix append tl
}