/opt/scala/bin/scalac: line 50: /dev/null: Permission denied
Main.scala:11: error: value Cons is not a member of Stream[A]
lazy val tail = tl Cons(() => head, () => tail)
^
Main.scala:12: error: type mismatch;
found : Unit
required: Stream[A]
}
^
Main.scala:20: error: not found: type A
def toListFast: List[A] = {
^
Main.scala:21: error: not found: type A
val buf = new collection.mutable.ListBuffer[A]
^
Main.scala:24: error: not found: type A
def go(s: Stream[A]): List[A] = s match {
^
Main.scala:24: error: not found: type A
def go(s: Stream[A]): List[A] = s match {
^
Main.scala:31: error: not found: type A
def take(n: Int): Stream[A] =
^
Main.scala:33: error: constructor cannot be instantiated to expected type;
found : Cons[A]
required: Stream.type
case Cons(h, t) if n == 1 => cons(h(), Stream.empty) // we can say Stream.empty
^
Main.scala:33: error: not found: value h
case Cons(h, t) if n == 1 => cons(h(), Stream.empty) // we can say Stream.empty
^
Main.scala:34: error: constructor cannot be instantiated to expected type;
found : Cons[A]
required: Stream.type
case Cons(h, t) => cons(h(), t().take(n-1))
^
Main.scala:34: error: not found: value h
case Cons(h, t) => cons(h(), t().take(n-1))
^
Main.scala:34: error: not found: value t
case Cons(h, t) => cons(h(), t().take(n-1))
^
Main.scala:45: error: value take is not a member of Stream[Int]
println(constant(5).take(3).toList)
^
13 errors found
spoj: The program compiled successfully, but Main.class was not found.
Class Main should contain method: def main(args: Array[String]).