Understand ZIO and its aliases
Jun 22, 2021
When R and E in the type ZIO[-R, +E, +A] are replaced with some special types, its aliases can be used to simplify them. Therefore, it has been expressed that, on the one hand codes are simplified, on the other hand our program can focus on special meanings of these alias types, and make us to understand and think about application logic more naturally.
If we put these special alias types into a table, we can understand relationships among them at once:
+=====+===========+===========+============+
| . | Nothing | Throwable | E |
+=====+===========+===========+============+
| Any | UIO[A] | Task[A] | IO[E,A] |
+-----+-----------+-----------+------------+
| R | URIO[R,A] | RIO[R,A] | ZIO[R,E,A] |
+-----+-----------+-----------+------------+