It is necessary to write the map implementation using the terms of the unfold function in the Scala language. It should look like this in the end:
def map[B](a :List[A])(f: A => B): Stream[B] = unfold()()
Accordingly, it is necessary to pass the correct arguments to the unfold function.
Here is the implementation of the unfold function:
def unfold[A, S](z: S)(f: S => Option[(A, S)]): Stream[A] = f(z) match { case Some((a, s)) => Stream.cons(a, unfold(s)(f)) case None => Stream.empty }
I beg for help.