fmap

fmap(items: Iterable[In], fn: Callable[[In], Out])

Apply fn to each element in items.

The difference to the build-in map() is the order of the arguments and that the output is always a list.

Parameters

items : Iterable[In]

The sequence of items, such as a list, array, or dict.

fn : Callable[[In], Out]

The function to apply.

Returns

list[Out]

A list with the output values after the function is applied.