David Kubecka
01/10/2024, 4:17 PMmyResult
.getOrThrow { createException() }
.let { transform(it) }
I was thinking of something similar to mapBoth
which, however, maps both Ok and Err to a common type.Youssef Shoaib [MOD]
01/10/2024, 4:29 PMfold
function. I'm not sure if kotlin-result
provides it, but the implementation is likely trivial.raulraja
01/10/2024, 9:02 PMDavid Kubecka
01/11/2024, 9:11 AMfold
is the same as mapBoth
and as I said I do want to throw an exception for the error case, not a result.Youssef Shoaib [MOD]
01/11/2024, 9:14 AMfold(transform) { throw createException() }
will do the trickDavid Kubecka
01/11/2024, 9:16 AM