Applies a mapper to a defined value.
Binds a value to a mapper of its own, so a computation reads as a scoped expression rather than as a temporary variable followed by a statement. The value is known to be defined, so the mapper is always called and its result is reported unchanged.
The type of the value to map, known to exclude undefined
The value to hand on to the mapper
A function reporting the value computed from value by its mapper argument; errors raised by the mapper
propagate to the caller unchanged
Applies a mapper to a possibly undefined value.
Extends the mapper with a tolerance for undefined values: a defined value is handed on to it stripped of undefined,
while an undefined one short-circuits to undefined without calling it, so an optional value flows through a chain
of total functions without a guard at every step. Definedness is about assignment rather than emptiness, so null
is mapped like any other value.
The type of the value to map, possibly including undefined
The value to hand on to the mapper, if defined
A function reporting undefined if value is undefined, and the value computed by its mapper argument
otherwise; errors raised by the mapper propagate to the caller unchanged
Applies a mapper to a value, short-circuiting an undefined one.