Overview of ZIO Prelude capabilities
series/2.xZIO Prelude is a lightweight library providing functional abstractions and data types with tight ZIO integration. It focuses on three main areas:
- Data structures and traversal: Extends Scala standard library collections with new instances and useful additions.
- Patterns of composition for types: Provides binary operators for combining two values of the same type, named after algebraic laws like
Associative,Commutative, andIdentity. - Patterns of composition for type constructors: Provides binary operators for type constructors (e.g.,
Future,Option,ZIO) that produce structures like tuples or Eithers.
Key features include:
- Functional Data Types: Types like
NonEmptyList,NonEmptySet,ZSet,ZNonEmptySet,Validation, andZValidationfor accurate domain modeling. - Functional Abstractions: Ways to combine data in a principled manner.
- New Types: Zero-overhead
Subtypewrappers to increase type safety in domain modeling. - ZPure: A high-performance alternative to monad transformers that supports logging, context, state, and errors.
- zio.prelude.fx: A research-stage package providing abstractions over expressive effect types like ZIO and
ZPure.