fold

inline fun <T> fold(onLeft: (L) -> T, onRight: (R) -> T): T