Combining ReaderTaskEithers with different contexts using pipe and flatMap
In fp-ts i can combine
In the end I just have to provide the right context object :
Do I understand correctly that in
ReaderTaskEithers using a pipe with other ReaderTaskEithers that need different context (the R type parameter). When using flatMap (which is an equivalent of chainW) I "widen" the scope of the resulting ReaderTaskEither so each of my functions returning an RTE will have their independent list of dependencies and I don't have to mention them in the others:In the end I just have to provide the right context object :
foo()(context).Do I understand correctly that in
Effect there is no "widening", and this problem is solved with Layers (as opposed to just using plain service dependencies).