Did you know that you can navigate the posts by swiping left and right?

Using ZIO 2, Scala 3 and more

31 Dec 2022 . category: dev . Comments
#scala #fp #scala3 #zio

I wanted to learn the basics of ZIO 2 and Scala 3, so I built a small project with them.

ZIO logo

Challenge

I found no articles on using ZIO 2, Scala 3, Tapir, Doobie, Postgres and Docker together.

Most how-tos were for ZIO 1 or Scala 2, so I had to bump all the versions and dig into the migration guides.

The surprise was the versioning of zio-interop-cats, the library needed to use Doobie (built on Cats Effect) with ZIO. Its first number encodes the target ZIO and Cats Effect versions: 13.x is for ZIO 1 with Cats Effect 3, 22.x for ZIO 2 with Cats Effect 2. Both look newer than 3.3.0, which I used for ZIO 2 with Cats Effect 3. Keep that in mind when a plugin suggests dependency updates.

See how I solved it in the project on GitHub: affirmations.

Scala logo


Me

Waldemar Wosiński - Scala & Big Data engineer, father and motorcyclist ;)