blob: 5853f8675ec3a5ff9685e36828a1169d5812decb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
object Test {
import Coll._
import LazyList.#::
val xs = LazyList.Empty
}
object Coll {
trait IterableFactory[+C[X]]
class LazyList[+A](expr: => LazyList.Evaluated[A])
object LazyList extends IterableFactory[LazyList] {
type Evaluated[+A] = Option[(A, LazyList[A])]
object Empty extends LazyList[Nothing](None)
object #:: {
def unapply[A](s: LazyList[A]): Evaluated[A] = ???
}
}
}
|