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 [a <: b] (rest: => scala.Stream[b]) : scala.Stream[b]
| `def` apply (n: scala.Int) : a
| `def` at (n: scala.Int) : a
`override` | `def` copyToArray [a <: b] (xs: scala.Array[b], start: scala.Int) : scala.Array[b]
`override` | `def` drop (n: scala.Int) : scala.Stream[a]
| `def` dropWhile (p: scala.Function1[a, scala.Boolean]) : scala.Stream[a]
| `def` elements : scala.Iterator[a]
`override` | `def` exists (p: scala.Function1[a, scala.Boolean]) : scala.Boolean
| `def` filter (p: scala.Function1[a, scala.Boolean]) : scala.Stream[a]
| `def` flatMap [b] (f: scala.Function1[a, scala.Stream[b]]) : scala.Stream[b]
`override` | `def` foldLeft [b] (z: b)(f: scala.Function2[b, a, b]) : b
`override` | `def` foldRight [b] (z: b)(f: scala.Function2[a, b, b]) : b
`override` | `def` forall (p: scala.Function1[a, scala.Boolean]) : scala.Boolean
`override` | `def` foreach (f: scala.Function1[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: scala.Function1[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 [a <: b] (f: scala.Function2[b, b, b]) : b
| `def` reduceRight [a <: b] (f: scala.Function2[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: scala.Function1[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 Detail

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

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

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

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

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

`def` dropWhile (p: scala.Function1[a, scala.Boolean]): scala.Stream[a]

`def` elements : scala.Iterator[a]

`override def` exists (p: scala.Function1[a, scala.Boolean]): scala.Boolean

`def` filter (p: scala.Function1[a, scala.Boolean]): scala.Stream[a]

`def` flatMap [b](f: scala.Function1[a, scala.Stream[b]]): scala.Stream[b]

`override def` foldLeft [b](z: b)(f: scala.Function2[b, a, b]): b

`override def` foldRight [b](z: b)(f: scala.Function2[a, b, b]): b

`override def` forall (p: scala.Function1[a, scala.Boolean]): scala.Boolean

`override def` foreach (f: scala.Function1[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: scala.Function1[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 [a <: b](f: scala.Function2[b, b, b]): b

`def` reduceRight [a <: b](f: scala.Function2[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: scala.Function1[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]]