Data Validation in Scala with ZIO Prelude

December 20, 2020

ZIO Validation is a new library made to help functional programming with algebraic constructions in Scala.
It aims to be simpler and to fit better to the Scala language than Cats and Scalaz.

Here is a simple data validation example (using Scala 3 indentation-based syntax) :

As you can see it is really easy to mix monadic error handling (stop at first error) with Either (or Option) and validation of multiple errors (parallel validation instead of stpping at first error) with the ZIO Prelude Validation data type.

P.S. : I’d like to thank the Univalence team for their youtube channel and their unboxing video of ZIO Prelude.

comments powered by Disqus