any alternatives for implementation below? flatMap...
# arrow-contributors
r
any alternatives for implementation below? flatMap would be really useful
Copy code
fun <A, B, C> Kind<F, Either<A, B>>.branch(fl: Kind<F, (A) -> C>, fr: Kind<F, (B) -> C>): Kind<F, C> =
      map { it.fold(
        {l -> just(Left(l)).select(fl)},
        { r -> just(Left(r)).select(fr) } )
      }
current not compiling as it returns
Kind<F, Kind<F, C>>