Effect CommunityEC
Effect Communityβ€’3y agoβ€’
109 replies
mattphillips

Inquiry about Type Aliases for Effect in Comparison to ZIO

Hey I can't seem to find any type aliases for Effect, do any exist? Something similar to ZIO's UIO/URIO/RIO/Task/IO is what I'm looking for. If not, have/would you consider adding them?

I find the following to be a compelling justification for using them to help specify the exact power needed in an API and generally makes it way quicker/easier to read in my experience.

PRINCIPLE OF THE LEAST POWER
The ZIO data type is the most powerful effect in the ZIO library. It helps us to model various types of workflows. On other hand, the type aliases are a way of subtyping and specializing the ZIO type, specific for a less powerful workflow.
Lot of the time, we don't need such a piece of powerful machinery. So as a rule of thumb, whenever we require a less powerful effect, it's better to use the proper specialized type alias.
So there is no need to convert type aliases to the ZIO data type, and whenever the ZIO data type is required, we can use the most precise type alias to fit our workflow requirement.

Source: https://zio.dev/reference/core/zio/uio
Was this page helpful?