Composing Functionality within Services in Effect
Is there a built-in way in Effect that I use to compose the functionality that I have within services (as opposed to composing the services themselves)? Let's say that I have a service like this:
when executed this will return the user using the
What if I have an operation like this too:
and I want to combine them:
here all I do is pipe the output of
Is there some built-in way to compose services that have a shape like this (eg: functions that naturally compose, and only their dependencies are different)?
*I'm asking this because I come from fp-ts and in fp-ts this is very easy to do as I can do the piping:
and then supply the dependencies in the end like:
when executed this will return the user using the
userService which is a dependency of this service.What if I have an operation like this too:
and I want to combine them:
here all I do is pipe the output of
GetUserById into DeleteUserById since the signatures align nicely. Is there some built-in way to compose services that have a shape like this (eg: functions that naturally compose, and only their dependencies are different)?
*I'm asking this because I come from fp-ts and in fp-ts this is very easy to do as I can do the piping:
and then supply the dependencies in the end like:
