fold

inline fun <L, R, T : Any> Either<L, R>.fold(fnL: (L) -> T, fnR: (R) -> T): T

Applies fnL if this is a Left or fnR if this is a Right.

See also