Option::map
pub fn map<U>(T -> U f) -> Option<U>
Source: compiler/src/prelude/core.hy Some(f(value)), or None.
Called on a Option value as value.map(…).
Parameters#
| Name | Type |
|---|---|
f | T -> U |
Returns#
Option<U>
See also#
OptionOption::is_some: True when this isSome.Option::is_none: True when this isNone.Option::unwrap_or: The value, orfallbackwhenNone.Option::unwrap_or_else: The value, or the result offwhenNone.Option::map_or:f(value), orfallbackwhenNone.Option::and_then:f(value)(itself anOption), orNone.Option::or: This option if it isSome, otherwiseother.