I have a map:
Map(\"key1\" -> Some(\"value1\"), \"key2\" -> None, \"key3\" -> Some(\"value3\"))
I want to remove all None
None
Using partition over the map, like this,
val (flattened,_) = map.partition(_._2.isDefined)