in scala
trait Stream

`abstract trait` Stream [a]
  `extends` java.lang.Object
  `with` scala.Seq[a]
  `with` scala.ScalaObject

  The class `Stream` implements lazy lists where elements are only evaluated when they are needed. Here is an example:

       object Main extends Application {

         def from(n: Int): Stream[Int] =
           Stream.cons(n, from(n + 1))

         def sieve(s: Stream[Int]): Stream[Int] =
           Stream.cons(s.head, sieve(s.tail filter { x => x % s.head != 0 }))

         def primes = sieve(from(2))

         primes take 10 print
       }

Author:
  Martin Odersky, Matthias Zenger
Version:
  1.1 08/08/03

Def Summary
| `def` append [b >: a] (rest: => scala.Stream[b]) : scala.Stream[b]
| `def` apply (n: scala.Int) : a
| `def` at (n: scala.Int) : a
`override` | `def` copyToArray [b >: a] (xs: scala.Array[b], start: scala.Int) : scala.Array[b]
`override` | `def` drop (n: scala.Int) : scala.Stream[a]
| `def` dropWhile (p: (a) => scala.Boolean) : scala.Stream[a]
| `def` elements : scala.Iterator[a]
`override` | `def` exists (p: (a) => scala.Boolean) : scala.Boolean
| `def` filter (p: (a) => scala.Boolean) : scala.Stream[a]
| `def` flatMap [b] (f: (a) => scala.Stream[b]) : scala.Stream[b]
`override` | `def` foldLeft [b] (z: b)(f: (b, a) => b) : b
`override` | `def` foldRight [b] (z: b)(f: (a, b) => b) : b
`override` | `def` forall (p: (a) => scala.Boolean) : scala.Boolean
`override` | `def` foreach (f: (a) => scala.Unit) : scala.Unit
`abstract` | `def` head : a
| `def` init : scala.Stream[a]
`abstract` `override` | `def` isEmpty : scala.Boolean
| `def` last : a
| `def` length : scala.Int
| `def` map [b] (f: (a) => b) : scala.Stream[b]
| `def` print : scala.Unit
`abstract` | `def` printElems (buf: scala.compat.StringBuilder, prefix: java.lang.String) : scala.compat.StringBuilder
| `def` reduceLeft [b >: a] (f: (b, b) => b) : b
| `def` reduceRight [b >: a] (f: (b, b) => b) : b
| `def` reverse : scala.Stream[a]
`abstract` | `def` tail : scala.Stream[a]
`override` | `def` take (n: scala.Int) : scala.Stream[a]
| `def` takeWhile (p: (a) => scala.Boolean) : scala.Stream[a]
`override` | `def` toString : java.lang.String
| `def` zip [b] (that: scala.Stream[b]) : scala.Stream[scala.Tuple2[a, b]]
| `def` zipWithIndex : scala.Stream[scala.Tuple2[a, scala.Int]]

Def inherited from scala.Seq[a]
concat , copyToArray, drop, indexOf, isDefinedAt, isEmpty, lastIndexOf, length, mkString, stringPrefix, subseq, take, toArray, toString

Def Detail

`def` append [b >: a](rest: => scala.Stream[b]): scala.Stream[b]

`def` apply (n: scala.Int): a

`def` at (n: scala.Int): a

`override def` copyToArray [b >: a](xs: scala.Array[b], start: scala.Int): scala.Array[b]

`override def` drop (n: scala.Int): scala.Stream[a]

`def` dropWhile (p: (a) => scala.Boolean): scala.Stream[a]

`def` elements : scala.Iterator[a]

`override def` exists (p: (a) => scala.Boolean): scala.Boolean

`def` filter (p: (a) => scala.Boolean): scala.Stream[a]

`def` flatMap [b](f: (a) => scala.Stream[b]): scala.Stream[b]

`override def` foldLeft [b](z: b)(f: (b, a) => b): b

`override def` foldRight [b](z: b)(f: (a, b) => b): b

`override def` forall (p: (a) => scala.Boolean): scala.Boolean

`override def` foreach (f: (a) => scala.Unit): scala.Unit

`abstract def` head : a

`def` init : scala.Stream[a]

`abstract override def` isEmpty : scala.Boolean

`def` last : a

`def` length : scala.Int

`def` map [b](f: (a) => b): scala.Stream[b]

`def` print : scala.Unit

`abstract def` printElems (buf: scala.compat.StringBuilder, prefix: java.lang.String): scala.compat.StringBuilder

`def` reduceLeft [b >: a](f: (b, b) => b): b

`def` reduceRight [b >: a](f: (b, b) => b): b

`def` reverse : scala.Stream[a]

`abstract def` tail : scala.Stream[a]

`override def` take (n: scala.Int): scala.Stream[a]

`def` takeWhile (p: (a) => scala.Boolean): scala.Stream[a]

`override def` toString : java.lang.String

`def` zip [b](that: scala.Stream[b]): scala.Stream[scala.Tuple2[a, b]]

`def` zipWithIndex : scala.Stream[scala.Tuple2[a, scala.Int]]