Exit e-book
Show all chapters
03
A deep look into the ZIO module structure
03. 
A deep look into the ZIO module structure

Sign up to our Newsletter

Signing up to our newsletter allows you to read all our ebooks.

I agree to receive marketing communication from Scalac.
You can unsubscribe from these communications at any time. For more information on how to unsubscribe, view our Privacy Policy.

Mastering Modularity in ZIO with Zlayer
03

A deep look into the ZIO module structure

As you may already know, ZIO is designed around three type parameters:

ZIO[-R, +E, +A]

You may also remember that a nice mental model of the ZIO data type is the following:

R => Either[E, A]

This means a ZIO effect needs an environment of type R to run, meaning we need to fulfill this requirement in order to make the effect runnable. More concretely, this R type represents a dependency on a module or several modules that are needed for running the effect.  Therefore, let’s now discuss how modules are defined in ZIO.

PREVIOUS
Chapter
02
NEXT
Chapter
04