pardom
inline fun <C> fold(ifLeft: (A) -> C, ifRight: (B) -> C): C = when (this) { is Right -> ifRight(b) is Left -> ifLeft(a) }