3

It might be a trivial question, but I am unable to find the documentation for it:

Inside Stream, and at other places I have seen examples using the method #::. For example:

val fibs: Stream[BigInt] = BigInt(0) #:: BigInt(1) #:: fibs.zip(fibs.tail).map { n => n._1 + n._2 }

But I dont find the documentation for implicit method #:: in the api. What is it? and where is it declared?

Jatin
  • 31,116
  • 15
  • 98
  • 163

1 Answers1

2

First value member of in the Stream.ConsWrapper. I found by using the symbol index on the left pane under the search box.

Here is its signature:

def #::(hd: A): Stream[A]

In few words is the List :: but for streams.

pedrofurla
  • 12,763
  • 1
  • 38
  • 49
  • But why is it hidden. It is so tough find it out – Jatin Apr 23 '13 at 06:33
  • Hidden is a bit hard. The problem is that left box in Scaladoc only shows the first level children. For that exact reason I made the reference index. I don't understand why ppl don't use it! – pedrofurla Apr 23 '13 at 06:48
  • Till now I assumed it to be starting character indexed search. Ideally, I would want Stream.consWrapper to be shown inside Stream api itself – Jatin Apr 23 '13 at 09:06