flat_map


Description:

public virtual Result<A> flat_map<A> (owned FlatMapFunc<A,G> func)

Maps the value to another result by applying the given function to the value.

If this result holds an exception, the returned result holds the exception too.

The returned object of the function may or may not be directly used. Depending on the internal implementation, A new result object will be created with the value or exception of it and returned, instead of returning it directly.

Parameters:

func

a function applied to value

Returns:

the new result