Wednesday, January 6, 2021

Reasons to hate Scala

 scala> val ll = 1 #:: 2 #:: 3 #:: LazyList.empty

val ll: scala.collection.immutable.LazyList[Int] = LazyList(<not computed>)


scala> val ss = 1 #:: 2 #:: 3 #:: Stream.empty

                        ^

       warning: object Stream in package immutable is deprecated (since 2.13.0): Use LazyList (which is fully lazy) instead of Stream (which has a lazy tail only)

                              ^

       warning: object Stream in package immutable is deprecated (since 2.13.0): Use LazyList (which is fully lazy) instead of Stream (which has a lazy tail only)

                                         ^

       warning: object Stream in package immutable is deprecated (since 2.13.0): Use LazyList (which is fully lazy) instead of Stream (which has a lazy tail only)

                                  ^

       warning: value Stream in package scala is deprecated (since 2.13.0): Use LazyList instead of Stream

val ss: scala.collection.immutable.Stream[Int] = Stream(1, <not computed>)

No comments:

Post a Comment