Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case class Cons[+A](h: () => A, t: () => Stream[A]) extends Stream[A]
- object Stream {
- def cons[A](hd: => A, t: => Stream[A]): Stream[A] = {
- lazy val head = hd
- lazy val tail = t
- Cons(() => head, () => tail)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement