mapFirst

inline fun <A, B, R> Pair<A, B>.mapFirst(transform: (A) -> R): Pair<R, B>

Returns a new Pair whose first component is the result of transform applied to the current first component.

The second component is carried over unchanged.

Parameters

transform

mapping applied to the first component.


inline fun <A, B, C, R> Triple<A, B, C>.mapFirst(transform: (A) -> R): Triple<R, B, C>

Returns a new Triple whose first component is the result of transform applied to the current first component.

The other components are carried over unchanged.

Parameters

transform

mapping applied to the first component.