fold

inline fun <T, R> Result<T>.fold(onError: (Throwable) -> R, onSuccess: (T) -> R): R