Could someone please explain this piece of code:
val ns: Iterator[Int] = (1 to 3).iterator
ns.map(_ => () => block)
where
block: => Future[T]
Basically I'm just confused about what's going on with the _
, =>
, and Unit ()
syntax. The way I am trying to read it is 'we map a function which returns a function that takes no params and returns a Future[T] over the list of integers'. Is this correct? I'm always confused when I see multiple =>
operators in a row..