map

inline fun <L, R, R2> Either<L, R>.map(func: (right: R) -> R2): Either<L, R2>

Map the right value of this Either to a new value. Left values are unmodified.

Parameters

L

The type of left value

R

The current type of right value

R2

The new type of right value

func

A mapping function which turns an R into an R2