in scala
class Stream

mixin abstract `class` 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 with 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 : (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
| `def` head : a
| `def` init : scala.Stream[a]
| `def` isEmpty : scala.Boolean
| `def` last : a
| `def` length : scala.Int
| `def` map [ b ] ( f : (a) => b ) : scala.Stream[b]
| `def` print : scala.Unit
| `def` printElems ( buf : java.lang.StringBuffer , prefix : java.lang.String ) : java.lang.StringBuffer
| `def` reduceLeft [ a <: b ] ( f : (b, b) => b ) : b
| `def` reduceRight [ a <: b ] ( f : (b, b) => b ) : b
| `def` reverse : scala.Stream[a]
| `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 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 : (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

`def` head : a

`def` init : scala.Stream[a]

`def` isEmpty : scala.Boolean

`def` last : a

`def` length : scala.Int

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

`def` print : scala.Unit

`def` printElems ( buf : java.lang.StringBuffer , prefix : java.lang.String ) : java.lang.StringBuffer

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

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

`def` reverse : scala.Stream[a]

`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]]