scala collection mapdocumentation says this in map:
Creates a new collection by applying a function to all elements of this list.
therefore, it works with every item in the collection.
but for verification, he says:
Displays the given function with the value from this Success or returns it if it is a failure.
therefore it only works on success, while I cannot understand anything to work on failure, I could still just print it. why is this incompatible with the collection map interface? I need to check what mapdoes for each data structure that I use, and can it behave differently?
source
share