arrow-core-data / arrow.core / Option / map

map

inline fun <B> map(f: (A) -> B): Option<B>

Returns a Some$B containing the result of applying $f to this $option’s value if this $option is nonempty. Otherwise return $none.

Parameters

f - the function to apply

Note This is similar to flatMap except here, $f does not need to wrap its result in an $option.

See Also

flatMap

Do you like Arrow?

Arrow Org
<