seasonedcc / composable-functions

Types and functions to make composition easy and safe
MIT License
649 stars 13 forks source link

Add a function for sequential compositions with same arguments #142

Closed gustavoguichard closed 2 months ago

gustavoguichard commented 3 months ago

TODO:

gustavoguichard commented 3 months ago

I'm not sure how to name this function. tap seems like a nice name but it is not quite what is happening here. It is probably one of the applications of this combinator, like running side effects in sequence.

Ramda has a definition for tap: https://ramdajs.com/0.21.0/docs/#tap Rxjx also has a definition for it: https://rxjs.dev/api/index/function/tap

diogob commented 3 months ago

Ramda has a definition for tap: https://ramdajs.com/0.21.0/docs/#tap Rxjx also has a definition for it: https://rxjs.dev/api/index/function/tap

I think what bothers me with the tap name is that on both the examples it refers to some subject (object in Ramda and Observable in RxJS) we return once the computations as done.

In our case, since we have only a function that receives all the computations and must return another computation, the name tap feels counter-intuitive.

gustavoguichard commented 3 months ago

Just to register it here too: What about allInSequence?