concept different type in category akka

appears as: different type, different types, different types
Reactive Web Applications: With Play, Akka, and Reactive Streams

This is an excerpt from Manning's book Reactive Web Applications: With Play, Akka, and Reactive Streams.

That’s simple, isn’t it? map just takes each element of the collection, applies the function it has been called with, and returns a new collection. Note that you’re not limited to returning integers: if your function were to return another type, you’d end up with the same kind of collection, but with a different type of elements.

A frequent use case that arises when working with a library is transforming the library’s result into a type that’s more appropriate to the task at hand. Whether it’s one call producing a future, or several calls producing futures holding different types of results, being able to transform the content of a future without having to wait for it to complete is key to building more complex asynchronous computation pipelines.