July 2018
Intermediate to advanced
242 pages
8h 6m
English
The Sequence-based implementation is going to give us the following output:
Applying map function for aApplying map function for b[a, b]
As you can see, replacing the Collection data structure with the Sequence type allows us to gain the desired optimization.
The scenario considered in this recipe was implemented identically—first, using List, then using the Sequence type. However, we can notice the difference in the behavior of the Sequence data structure compared to that of Collection. The map() function was applied only to the first two elements of the sequence, even though the take() function was called after the mapping transformation declaration. It's also worth noting that in the example using Collection, the mapping ...
Read now
Unlock full access