Is `LiveData` a monad that would benefit from the ...
# arrow
k
Is
LiveData
a monad that would benefit from the Rx treatment in Arrow? Its got
pure
in
MutableLiveData(…)
,
Transformations.map(myLiveData, myTransformation)
is
map
, and
Transformations.switchMap(myLiveData, myTransformationFn)
is like
flatMap
. And because it is lazy until there is a registered observer, it could be thought of as
IO
. I guess.
IO.unsafeRunAsync
is basically
SomeLiveData.observe(…)
That’s why I’m asking the experts here 🙂
p
I’ve been waiting 2 years and a bit for this question 😁
unless something substantial has changed since the first implementation
it was too slow to be usable
every operator does some checking and trampolinin operations which added massive overhead
and the recursion/nesting checks would never complete
I asked Jose, and he told me the implementation was meant to have one or two operators applied, no more.
You can try again, see if MonadLaws complete correctly on a reasonable amount of time
I’m curious about the results
1
s
the implementation was meant to have one or two operators applied, no more.
🙃