Search code examples
scalascalaz-stream

What is a good way to implement a "delayed" list stream in Scalaz


I tried doing this, but that did not work:

Process("Hello", "Salut", "Bye", "Ciao").interleave(time.sleep(0.5.seconds).repeat)

Solution

  • (Process("Hello", "Salut", "Bye", "Ciao") zip (time.awakeEvery(0.5 s)) .map(_._1)