#horstmann-java8-for-really-impatient #java #java8 #p26

You may find a flatMap method in classes other than streams. It is a general concept in computer science. Suppose you have a generic type G (such as Stream) and functions f from some type T to G<U> and g from U to G<V>. Then you can compose them, that is, first apply f and then g, by using flatMap. This is a key idea in the theory of monads.


Discussion

Do you want to join discussion? Click here to log in or create user.