Top "Flatmap" questions

flatMap is a Java and Scala function that works by applying a function that returns a sequence for each element in the list, and flattening the results into the original list.

Java 8 Streams FlatMap method example

I have been checking the upcoming Java update, namely: Java 8 or JDK 8. Yes, I am impatient, there's a lot of …

java java-8 java-stream flatmap
When do you use map vs flatMap in RxJava?

When do you use map vs flatMap in RxJava? Say, for example, we want to map Files containing JSON into …

java mapping rx-java flatmap
Return multiple values from ES6 map() function

Say I have something like this: let values = [1,2,3,4]; let newValues = values.map((v) => { return v *v ; }); console.log(newValues); //[1,4,9,16] …

collections ecmascript-6 flatmap
What is the use case for flatMap vs map in kotlin

in https://try.kotlinlang.org/#/Kotlin%20Koans/Collections/FlatMap/Task.kt it has sample of using flatMap and map seems …

collections kotlin flatmap
What is the difference between concatMap and flatMap in RxJava

It seems that these 2 functions are pretty similar. They have same signature (accepting rx.functions.Func1<? super T, ? extends …

java rx-java flatmap concatmap
In RxJava, how to pass a variable along when chaining observables?

I am chaining async operations using RxJava, and I'd like to pass some variable downstream: Observable .from(modifications) .flatmap( (data1) …

java rx-java reactive-programming flatmap
Javascript - flatMap method over array - (flatMap is not a function)

According to the Mozilla Developer Website: The flatMap() method first maps each element using a mapping function, then flattens the …

javascript arrays node.js ecmascript-6 flatmap
PySpark Throwing error Method __getnewargs__([]) does not exist

I have a set of files. The path to the files are saved in a file., say all_files.txt. …

python apache-spark pyspark flatmap
How to use swift flatMap to filter out optionals from an array

I'm a little confused around flatMap (added to Swift 1.2) Say I have an array of some optional type e.g. …

swift functional-programming optional higher-order-functions flatmap
Spark: FlatMapValues query

I'm reading the Learning Spark book and couldn't understand the following pair rdd transformation. rdd.flatMapValues(x => (x to 5)) …

apache-spark flatmap