Anyone acknowledge any library that supports those...
# arrow
t
Anyone acknowledge any library that supports those convenient functions for using Arrow data types with RxJava like this one?:
Copy code
fun <T, R> Observable<Either<Throwable, T>>.flatMapEither(mapper: (T) -> Observable<R>): Observable<Either<Throwable, R>> {
    return flatMap {
        when (it) {
            is Either.Right -> mapper(it.b).map { it.right() as BeckonResult<R> }
            is Either.Left -> Observable.just(it)
        }
    }
}
i
you can also use the Rx wrappers for Arrow Datatypes https://next.arrow-kt.io/docs/integrations/rx2/
Feel free to open a PR if you want to add something 🙂
t
Thanks, I read that document, but I want a simpler way to introduce Arrow (begin with simple data types) to our currents projects rather than change the way we write it completely. I think it will be a gradual process.
👌🏽 1
p
That’s an EitherT transformer, like the ones we were discussing before. Without KEEP87 or a compiler pluging they’re difficult to generalise, and we cannot ship a specialized version
👍 1
t
I totally understand the problem with Keep87. It's just my approach to introduce Arrow to my team. A term like Monad Transformer may scare people at first.
p
Oh, makes sense 😄