I know java streams, and tried to implement the map, filter, fold (with custom function as argument), both the strict and lazy evaluation ways.
However i could not implement a lazy implementation of flatmap in java. Normal map,filter, fold are just composed functions which run on the main iterator (if its list) and apply of functions is discarded if the incoming value is null.
However flatMap input function produces another list( stream) which needs to be flattened,
How is the lazy flatMap implemented in java 10? is there any document on the algorithm?
Thanks.