Composes successful container with a pure function. .. code:: python >>> from returns.io import IOSuccess >>> assert IOSuccess(1).map(lambda num: num + 1) == IOSuccess(2)
(
self,
function: Callable[[_ValueType_co], _NewValueType],
)
| 387 | return self.from_result(self._inner_value.swap()) |
| 388 | |
| 389 | def map( |
| 390 | self, |
| 391 | function: Callable[[_ValueType_co], _NewValueType], |
| 392 | ) -> 'IOResult[_NewValueType, _ErrorType_co]': |
| 393 | """ |
| 394 | Composes successful container with a pure function. |
| 395 | |
| 396 | .. code:: python |
| 397 | |
| 398 | >>> from returns.io import IOSuccess |
| 399 | >>> assert IOSuccess(1).map(lambda num: num + 1) == IOSuccess(2) |
| 400 | |
| 401 | """ |
| 402 | return self.from_result(self._inner_value.map(function)) |
| 403 | |
| 404 | def apply( |
| 405 | self, |
nothing calls this directly
no test coverage detected