`Option<Unit>` seems like a better option th...
# arrow
s
Option<Unit>
seems like a better option than
Either
t
I guess you can create your own extension function, though I don’t really see a use case for it, I find
if
expressions good enough. Something like:
Copy code
fun <R> Boolean.fold(ff: () -> R, ft: () -> R): R = if (this) ft() else ff()
s
Simon shared conditionally(), which does the perfect job. Thank you for providing an option, Tiberiu 🙌
👍 1