Open shubham08gupta opened 3 years ago
How about having a suspending version of the fold operator? Something like(please excuse the name):
fold
suspend fun foldSuspend(fnL: suspend (L) -> Any, fnR: suspend (R) -> Any): Any = when (this) { is Left -> fnL(a) is Right -> fnR(b) }
Currently, it is:
fun fold(fnL: (L) -> Any, fnR: (R) -> Any): Any = when (this) { is Left -> fnL(a) is Right -> fnR(b) }
Is it a good practice to keep 2 versions of the same function?
How about having a suspending version of the
fold
operator? Something like(please excuse the name):Currently, it is:
Is it a good practice to keep 2 versions of the same function?