# ZIO > Type-safe, composable asynchronous and concurrent programming for Scala. This file contains links to documentation sections following the llmstxt.org standard. ## Table of Contents - [Basic Concurrency](https://zio.dev/overview/basic-concurrency.md): Introduction to ZIO's fiber-based concurrency model with operators for forking, joining, parallelism, racing, and resource-safe timeouts. - [Basic Operations](https://zio.dev/overview/basic-operations.md): Guide to transforming and combining ZIO effects using mapping, chaining, for-comprehensions, and zipping operations. - [Creating Effects](https://zio.dev/overview/creating-effects.md): Comprehensive guide to creating ZIO effects from values, Scala data types, and converting synchronous or asynchronous code. - [Handling Errors](https://zio.dev/overview/handling-errors.md): Error handling tools for catching, recovering, and retrying ZIO effects with safe fallback strategies and robust error management. - [Handling Resources](https://zio.dev/overview/handling-resources.md): Learn how to manage resources safely in ZIO with Scope, acquire-release patterns, and ensure no resource leaks even under failure or interruption. - [Getting Started with ZIO](https://zio.dev/zio-aws/getting-started.md): Get started with ZIO, a powerful functional effect system for Scala that enables asynchronous, concurrent, and parallel programming. - [Performance](https://zio.dev/overview/performance.md): Optimize your ZIO applications for maximum throughput and minimal latency with batching, caching, and streaming techniques. - [Platforms](https://zio.dev/overview/platforms.md): Configure ZIO for different platforms including JVM, JavaScript, and Native with platform-specific services and runtimes. - [Running Effects](https://zio.dev/overview/running-effects.md): Guide to executing ZIO effects using ZIOAppDefault, Runtime, and custom environments with error logging integration. - [Summary](https://zio.dev/overview/summary.md): ZIO is a next-generation framework for building cloud-native applications on the JVM. With a beginner-friendly yet powerful functional core, ZIO le... - [Architectural Patterns](https://zio.dev/reference/architecture/architectural-patterns.md): In this section, we are going to talk about the design elements of a ZIO application and the ZIO idiomatic way of structuring codes to write ZIO ap... - [Functional Design Patterns](https://zio.dev/reference/architecture/functional-design-patterns.md): When designing an API, there are patterns that are commonly used. In this section, we are going to talk about some of these patterns: - [Non-functional Requirements](https://zio.dev/reference/architecture/non-functional-requirements.md): Designing and architecting a software system is a complex task. We should consider both the functional and non-functional requirements of the system. - [Programming Paradigms in ZIO](https://zio.dev/reference/architecture/programming-paradigms-in-zio.md): It is important to realize that the programming paradigm used to write a software system has a significant impact on its design and architecture. I... - [Hub](https://zio.dev/reference/concurrency/hub.md): A `Hub` is an asynchronous message hub. Publishers can publish messages to the hub and subscribers can subscribe to receive messagesfrom the hub. - [Introduction to Concurrent Programming in ZIO](https://zio.dev/reference/index.md): Lock-free, composable, non-blocking concurrency model in ZIO for safe multi-fiber coordination using atomic primitives like Ref and Promise. - [Promise](https://zio.dev/reference/concurrency/promise.md): A purely functional synchronization primitive that enables fiber coordination through a single value set exactly once. - [Queue](https://zio.dev/reference/concurrency/queue.md): Lightweight, fully asynchronous in-memory queue with composable back-pressure for fiber coordination. - [Ref](https://zio.dev/reference/concurrency/ref.md): Thread-safe atomic reference for managing immutable state in concurrent ZIO applications. - [Ref.Synchronized](https://zio.dev/reference/concurrency/refsynchronized.md): Mutable reference supporting atomic and effectful updates for managing shared state concurrently. - [Semaphore](https://zio.dev/reference/concurrency/semaphore.md): A synchronization primitive that safely manages permit-based fiber coordination with automatic release guarantees. - [Introduction to Configuration in ZIO](https://zio.dev/reference/index-2.md): Guide to ZIO's unified configuration system: describe configs declaratively and load them via ConfigProvider. - [Automatic ZLayer Derivation](https://zio.dev/reference/contextual/automatic-zlayer-derivation.md): ZIO's `ZLayer` is a powerful tool for building modular, testable, and composable applications. With the `ZLayer.derive` - [Introduction to the ZIO's Contextual Data Types](https://zio.dev/reference/index-3.md): ZIO's contextual abstraction for encoding environments that effects require, enabling dependency injection and service composition through type-saf... - [Layer](https://zio.dev/reference/contextual/layer.md): `Layer[+E, +ROut]` is a type alias for `ZLayer[Any, E, ROut]`, which represents a layer that doesn't require any services, it may fail with an erro... - [RLayer](https://zio.dev/reference/contextual/rlayer.md): `RLayer[-RIn, +ROut]` is a type alias for `ZLayer[RIn, Throwable, ROut]`, which represents a layer that requires `RIn` as its input, it may fail wi... - [TaskLayer](https://zio.dev/reference/contextual/tasklayer.md): `TaskLayer[+ROut]` is a type alias for `ZLayer[Any, Throwable, ROut]`, which represents a layer that doesn't require any services as its input, it ... - [ULayer](https://zio.dev/reference/contextual/ulayer.md): `ULayer[+ROut]` is a type alias for `ZLayer[Any, Nothing, ROut]`, which represents a layer that doesn't require any services as its input, it can't... - [URLayer](https://zio.dev/reference/contextual/urlayer.md): `URLayer[-RIn, +ROut]` is a type alias for `ZLayer[RIn, Nothing, ROut]`, which represents a layer that requires `RIn` as its input, it can't fail, ... - [ZEnvironment](https://zio.dev/reference/contextual/zenvironment.md): Understand ZEnvironment, the type-level map that maintains and manages environmental services and implementations for ZIO effects. - [ZIO Environment Use-cases](https://zio.dev/reference/contextual/zio-environment-use-cases.md): Explore practical ZIO environment use cases for local capabilities and business logic dependencies with service organization patterns. - [ZLayer](https://zio.dev/reference/contextual/zlayer.md): ZLayer provides composable recipes for constructing services with type-safe dependency management and asynchronous resource handling. - [Introduction to ZIO's Control Flow Operators](https://zio.dev/reference/index-4.md): Although we have access to built-in Scala control flow structures, ZIO has several control flow combinators. In this section, we are going to intro... - [Cause](https://zio.dev/reference/core/cause.md): The `ZIO[R, E, A]` effect is polymorphic in values of type `E` and we can work with any error type that we want, but there is a lot of information ... - [Exit](https://zio.dev/reference/core/exit.md): Exit type represents ZIO fiber outcomes as either Success with a value or Failure with a typed error Cause. - [Core Data Types](https://zio.dev/reference/index-5.md): Foundational data types for ZIO applications including effect values, type aliases, runtime execution, exit values, and failure causes. - [Runtime](https://zio.dev/reference/core/runtime.md): A `Runtime[R]` is capable of executing tasks within an environment `R`. - [IO](https://zio.dev/reference/core/zio/io.md): `IO[E, A]` is a type alias for `ZIO[Any, E, A]`, which represents an effect that has no requirements, and may fail with an `E`, or succeed with an ... - [RIO](https://zio.dev/reference/core/zio/rio.md): `RIO[R, A]` is a type alias for `ZIO[R, Throwable, A]`, which represents an effect that requires an `R`, and may fail with a `Throwable` value, or ... - [Task](https://zio.dev/reference/core/zio/task.md): `Task[A]` is a type alias for `ZIO[Any, Throwable, A]`, which represents an effect that has no requirements, and may fail with a `Throwable` value,... - [UIO](https://zio.dev/reference/core/zio/uio.md): Type alias for ZIO[Any, Nothing, A] representing an infallible effect that requires no environment and cannot fail, always succeeding with a value. - [URIO](https://zio.dev/reference/core/zio/urio.md): Type alias for ZIO[R, Nothing, A] representing an effect requiring environment R that cannot fail but succeeds with value A. - [ZIO](https://zio.dev/reference/core/zio.md): Immutable lazy value that describes workflows with fiber-based concurrency and typed error and success values. - [ZIOApp](https://zio.dev/reference/core/zioapp.md): Entry point trait for ZIO applications supporting custom environments, composable layers, and graceful shutdown handling. - [Automatic Layer Construction](https://zio.dev/reference/di/automatic-layer-construction.md): ZIO also has an automatic layer construction facility, which takes care of building dependency graphs from the individual layers and building block... - [Building Dependency Graph](https://zio.dev/reference/di/building-dependency-graph.md): Build dependency graphs in ZIO using manual layer composition or automatic dependency injection with compile-time validation. - [Getting Started With Dependency Injection in ZIO](https://zio.dev/reference/di/dependency-injection-in-zio.md): Master ZIO dependency injection: access services from environment, compose applications, build dependency graphs with ZLayer, and inject dependencies. - [Layers Are Shared by Default](https://zio.dev/reference/di/dependency-memoization.md): Layer memoization allows a layer to be created once and used multiple times in the dependency graph. So if we use the same layer twice, e.g. `(a >>... - [Dependency Propagation](https://zio.dev/reference/di/dependency-propagation.md): When we write an application, our application has a lot of dependencies. We need a way to provide implementations and to feed and propagate all dep... - [Examples](https://zio.dev/reference/di/examples.md): In the following example, we have an application that requires `AppConfig` layer, which itself requires `DBConfig` and `ServerConfig` layers: - [Introduction to Dependency Injection in ZIO](https://zio.dev/reference/index-6.md): Explore ZIO's built-in dependency injection system using ZIO Environment and ZLayer for type-safe, composable service management. - [Manual Layer Construction](https://zio.dev/reference/di/manual-layer-construction.md): Master manual ZLayer composition: horizontally combine layers, vertically feed outputs, manage hidden dependencies, and prevent cycles. - [Motivation](https://zio.dev/reference/di/motivation.md): :::caution - [Overriding Dependency Graph](https://zio.dev/reference/di/overriding-dependency-graph.md): Overview of overriding ZIO dependency graphs using global and local environments for flexible dependency injection. - [Providing Different Implementation of a Service](https://zio.dev/reference/di/providing-different-implementation-of-a-service.md): Provide multiple service implementations to ZIO applications without modifying core logic using dependency injection. - [ZLayer: Constructor as a Value](https://zio.dev/reference/di/zlayer-constructor-as-a-value.md): Before jumping into the next section, which will explain dependency injection in ZIO, let's take a look at the philosophy behind the `ZLayer` data ... - [Model Domain Errors Using Algebraic Data Types](https://zio.dev/reference/error-management/best-practices/algebraic-data-types.md): It is best to use _algebraic data types (ADTs)_ when modeling errors within the same domain or subdomain. - [Don't Type Unexpected Errors](https://zio.dev/reference/error-management/best-practices/unexpected-errors.md): Learn why unexpected errors should not be typed, and use orDie and refineOrDie to separate recoverable errors from application-killing defects. - [Don't Reflexively Log Errors](https://zio.dev/reference/error-management/best-practices/logging-errors.md): Avoid reflexively logging errors by leveraging ZIO's typed errors for guaranteed error propagation across your application. - [Use Union Types to Be More Specific About Error Types](https://zio.dev/reference/error-management/best-practices/union-types.md): In Scala 3, we have an exciting new feature called union types. By using the union operator, we can encode multiple error types. Using this facilit... - [Imperative vs. Declarative Error Handling](https://zio.dev/reference/error-management/imperative-vs-declarative.md): To figure out the benefit of typed errors in declarative error handling, we need to understand the drawbacks of the imperative approach and then se... - [Error Accumulation](https://zio.dev/reference/error-management/error-accumulation.md): Sequential combinators such as `ZIO#zip` and `ZIO.foreach` stop when they reach the first error and return immediately. So their policy on error ma... - [Examples](https://zio.dev/reference/error-management/examples.md): Let's write an application that takes numerator and denominator from the user and then print the result back to the user: - [Exceptional and Unexceptional Effects](https://zio.dev/reference/error-management/exceptional-and-unexceptional-effects.md): Besides the `IO` type alias, ZIO has four different type aliases which can be categorized into two different categories: - [Expected and Unexpected Errors](https://zio.dev/reference/error-management/expected-and-unexpected-errors.md): Distinguish between expected recoverable errors and unexpected defects, and learn how ZIO's type system reflects expected errors while sandboxing u... - [Introduction to Error Management in ZIO](https://zio.dev/reference/index-7.md): ZIO's comprehensive approach to handling typed errors with facilities for catching, propagating, and transforming errors type-safely. - [Chaining Effects Based on Errors](https://zio.dev/reference/error-management/operations/chaining-effects-based-on-errors.md): Unlike `ZIO#flatMap` the `ZIO#flatMapError` combinator chains two effects, where the second effect is dependent on the error channel of the first e... - [Converting Defects to Failures](https://zio.dev/reference/error-management/operations/converting-defects-to-failures.md): Convert ZIO defects back to typed failures using absorb and resurrect operators to recover from unexpected errors in your error handling flow. - [Error Refinement](https://zio.dev/reference/error-management/operations/error-refinement.md): ZIO has some operators useful for converting defects into failures. So we can take part in non-recoverable errors and convert them into the typed e... - [Exposing Errors in The Success Channel](https://zio.dev/reference/error-management/operations/exposing-errors-in-the-success-channel.md): Before taking into `ZIO#either` and `ZIO#absolve`, let's see their signature: - [Exposing the Cause in The Success Channel](https://zio.dev/reference/error-management/operations/exposing-the-cause-in-the-success-channel.md): Using the `ZIO#cause` operation we can expose the cause, and then by using `ZIO#uncause` we can reverse this operation: - [Filtering the Success Channel](https://zio.dev/reference/error-management/operations/filtering-the-success-channel.md): ZIO has a variety of operators that can filter values on the success channel based on a given predicate, and if the predicate fails, we can use dif... - [Flattening Optional Error Types](https://zio.dev/reference/error-management/operations/flattening-optional-error-types.md): If we have an optional error of type `E` in the error channel, we can flatten it to the `E` type using the `ZIO#flattenErrorOption` operator: - [Flipping Error and Success Channels](https://zio.dev/reference/error-management/operations/flipping-error-and-success-channels.md): Sometimes, we would like to apply some methods on the error channel which are specific for the success channel, or we want to apply some methods on... - [Map Operations](https://zio.dev/reference/error-management/operations/map-operations.md): Other than `ZIO#map` and `ZIO#flatMap`, ZIO has several other operators to manage errors while mapping: - [Merging the Error Channel into the Success Channel](https://zio.dev/reference/error-management/operations/merging-the-error-channel-into-the-success-channel.md): With `ZIO#merge` we can merge the error channel into the success channel: - [Rejecting Some Success Values](https://zio.dev/reference/error-management/operations/rejecting-some-success-values.md): We can reject some success values using the `ZIO#reject` operator: - [Tapping Errors](https://zio.dev/reference/error-management/operations/tapping-errors.md): Like [tapping for success values](../../core/zio/zio.md#tapping) ZIO has several operators for tapping error values. So we can peek into failures o... - [Zooming In on Nested Values](https://zio.dev/reference/error-management/operations/zooming-in-on-nested-values.md): We can extract a value from a Some using `ZIO#some` and then we can unsome it again using `ZIO#unsome`: - [Catching](https://zio.dev/reference/error-management/recovering/catching.md): If we want to catch and recover from all _typed error_ and effectfully attempt recovery, we can use the `ZIO#catchAll` operator: - [Fallback](https://zio.dev/reference/error-management/recovering/fallback.md): We can try one effect, or if it fails, try another effect with the `orElse` combinator: - [Folding](https://zio.dev/reference/error-management/recovering/folding.md): Scala's `Option` and `Either` data types have `fold`, which let us handle both failure and success at the same time. In a similar fashion, `ZIO` ef... - [Retrying](https://zio.dev/reference/error-management/recovering/retrying.md): ZIO retry mechanisms for handling transient failures with configurable policies and fallback recovery strategies. - [Sandboxing](https://zio.dev/reference/error-management/recovering/sandboxing.md): We know that a ZIO effect may fail due to a failure, a defect, a fiber interruption, or a combination of these causes. So a ZIO effect may contain ... - [Timing out](https://zio.dev/reference/error-management/recovering/timing-out.md): ZIO timeout combinators for managing effect execution time limits with safe interruption handling and customizable error recovery strategies. - [Sequential and Parallel Errors](https://zio.dev/reference/error-management/sequential-and-parallel-errors.md): A simple and regular ZIO application usually fails with one error, which is the first error encountered by the ZIO runtime: - [Typed Errors Guarantees](https://zio.dev/reference/error-management/typed-errors-guarantees.md): **Typed errors don't guarantee the absence of defects and interruptions.** Having an effect of type `ZIO[R, E, A]`, means it can fail because of so... - [Defects](https://zio.dev/reference/error-management/types/defects.md): Learn about ZIO defects—unexpected untyped errors created with ZIO.die—and how they differ from typed errors in error handling. - [Failures](https://zio.dev/reference/error-management/types/failures.md): Model expected typed errors in ZIO using ZIO.fail, including custom domain error types for better error handling and type safety. - [Fatal Errors](https://zio.dev/reference/error-management/types/fatals.md): In ZIO on the JVM platform, the `VirtualMachineError` and all its subtypes are the only errors considered fatal by the ZIO runtime. So if during th... - [Three Types of Errors](https://zio.dev/reference/error-management/index.md): Understand ZIO's three error types: failures (expected), defects (unexpected), and fatals (catastrophic), and how to handle each appropriately. - [Fiber](https://zio.dev/reference/fiber/fiber.md.md): Lightweight concurrency primitives for non-blocking, structured execution of ZIO effects with automatic supervision and interruption. - [FiberId](https://zio.dev/reference/fiber/fiberid.md): `FiberId` is the identity of a [Fiber](fiber.md), described by a globally unique sequence number and the time when it began life: - [Fiber.Status](https://zio.dev/reference/fiber/fiberstatus.md): `Fiber.Status` describes the current status of a [Fiber](fiber.md). - [Introduction to ZIO Fibers](https://zio.dev/reference/index-8.md): Virtual threads enabling lightweight concurrent execution on the JVM with typed error and success values. - [Introduction](https://zio.dev/index.md): ZIO contains a few data types that can help you solve complex problems in asynchronous and concurrent programming. ZIO data types categorize into t... - [Introduction to ZIO's Interruption Model](https://zio.dev/reference/index-9.md): Guide to ZIO's asynchronous interruption model for managing fiber interruption in concurrent applications, with patterns for blocking operations an... - [Introduction to Logging in ZIO](https://zio.dev/reference/observability/index.md): ZIO's lightweight built-in logging facade with support for log levels, spans, and contextual annotations. - [ZLogger](https://zio.dev/reference/observability/logging/zlogger.md): ZIO's functional logging trait: ZLogger[-Message, +Output] with composable fan-out, contramap, filterLogLevel, and ZTestLogger utilities. - [Counter](https://zio.dev/reference/observability/metrics/counter.md): A `Counter` is a metric representing a single numerical value that may be incremented over time. A typical use of this metric would be to track the... - [Frequency](https://zio.dev/reference/observability/metrics/frequency.md): A `Frequency` represents the number of occurrences of specified values. We can think of a `Frequency` as a set of counters associated with each val... - [Gauge](https://zio.dev/reference/observability/metrics/gauge.md): A `Gauge` is a metric representing a single numerical value that may be _set_ or _adjusted_. A typical use of this metric would be to track the cur... - [Histogram](https://zio.dev/reference/observability/metrics/histogram.md): A `Histogram` is a metric representing a collection of numerical with the distribution of the cumulative values over time. They organize a range of... - [Introduction to ZIO Metrics](https://zio.dev/reference/observability/index-2.md): ZIO's built-in metrics system for application observability with counter, gauge, histogram, summary, and frequency metric types. - [JVM Metrics](https://zio.dev/reference/observability/metrics/jvm.md): ZIO has built-in support for collecting JVM Metrics. These metrics are a direct port of the JVM metrics provided by the [Prometheus Java Hotspot li... - [MetricLabel](https://zio.dev/reference/observability/metrics/metriclabel.md): A `MetricLabel` metadata represents a key-value pair that allows analyzing metrics at an additional level of granularity. For example, if a metric ... - [Summary](https://zio.dev/reference/observability/metrics/summary.md): A `Summary` represents a sliding window of a time series along with metrics for certain percentiles of the time series, referred to as quantiles. - [Supervisor](https://zio.dev/reference/observability/supervisor.md): A `Supervisor[A]` is allowed to supervise the launching and termination of fibers, producing some visible value of type `A` from the supervision. - [Introduction to Tracing in ZIO](https://zio.dev/reference/observability/tracing.md): ZIO's distributed tracing support via OpenTelemetry API for tracking requests across multiple services in distributed systems. - [Cached: Automatic and Manual Resource Caching](https://zio.dev/reference/resource/cached.md): Cached provides automatic and manual caching of expensive resourceful values with scheduled refresh policies and graceful error handling. - [Introduction to Resource Management in ZIO](https://zio.dev/reference/index-10.md): ZIO resource management constructs for safe, composable acquisition and release of resources with guaranteed cleanup. - [Scope](https://zio.dev/reference/resource/scope.md): The Scope data type in ZIO represents resource lifetimes with guaranteed cleanup through finalizers, enabling safe and composable resource management. - [ScopedRef: Mutable Reference For Resources](https://zio.dev/reference/resource/scopedref.md): ScopedRef provides a resourceful mutable reference that automatically manages acquisition and release of scoped resources when values change. - [ZKeyedPool](https://zio.dev/reference/resource/zkeyedpool.md): The `ZKeyedPool[+Err, -Key, Item]` is a pool of items of type `Item` that are associated with a key of type `Key`. An attempt to get an item from a... - [ZPool](https://zio.dev/reference/resource/zpool.md): ZPool is an asynchronous pool of reusable resources for efficient management of expensive resources with dynamic sizing and lazy eviction policies. - [Built-in Schedules](https://zio.dev/reference/schedule/built-in-schedules.md): Discover ZIO's built-in schedule types for controlling effect repetition: fixed intervals, exponential backoff, and fibonacci-based delays. - [Schedule Combinators](https://zio.dev/reference/schedule/combinators.md): Schedules define stateful, possibly effectful, recurring schedules of events, and compose in a variety of ways. Combinators allow us to take schedu... - [Examples](https://zio.dev/reference/schedule/examples.md): Practical examples of creating and combining ZIO schedules for retrying with exponential backoff and exception handling. - [Introduction to Scheduling ZIO Effects](https://zio.dev/reference/index-11.md): Immutable values describing recurring effectful schedules for repeating actions or retrying on failures with configurable delays. - [Repetition](https://zio.dev/reference/schedule/repetition.md): In the case of repetition, ZIO has a `ZIO#repeat` function, which takes a schedule as a repetition policy and returns another effect that describes... - [Retrying](https://zio.dev/reference/schedule/retrying.md): In the case of retrying, ZIO has a `ZIO#retry` function, which takes a schedule as a repetition policy and returns another effect that describes an... - [Accessor Methods (deprecated)](https://zio.dev/reference/service-pattern/accessor-methods.md): Accessor methods are little helper methods that lookup a service from the environment, and then forward your call to - [Defining Polymorphic Services in ZIO](https://zio.dev/reference/service-pattern/defining-polymorphic-services-in-zio.md): As we discussed [here](../contextual/zenvironment.md), the `ZEnvironment`, which is the underlying data type used by `ZLayer`, is backed by a type-... - [Introduction to Writing ZIO Services](https://zio.dev/reference/introduction.md): Guide to ZIO Service Pattern: define maintainable services using interfaces and ZLayer for automatic dependency injection. - [Introduction to Reloadable Services](https://zio.dev/reference/service-pattern/reloadable-services.md): Learn how to implement reloadable services in ZIO with automatic resource management for configuration changes and scheduled refreshes. - [The Four Elements of Service Pattern](https://zio.dev/reference/service-pattern.md): Learn the four essential elements of ZIO Service Pattern: definition, implementation, dependencies, and ZLayer constructor lifting. - [The Three Laws of ZIO Environment](https://zio.dev/reference/service-pattern/the-three-laws-of-zio-environment.md): Master three ZIO environment laws: traits exclude dependencies, implementations use constructor injection, and business logic accesses services. - [Clock](https://zio.dev/reference/services/clock.md): Provides time-related operations for retrieving current time in various units, accessing date-time information, and non-blocking sleep functionality. - [Console](https://zio.dev/reference/services/console.md): Service providing simple I/O operations for reading/writing strings from/to standard input, output, and error console. - [Introduction to ZIO's Built-in Services](https://zio.dev/reference/index-12.md): Guide to ZIO's built-in services: Console, Clock, Random, and System with automatic environment management. - [Random](https://zio.dev/reference/services/random.md): Provides utilities to generate pseudo-random numbers with various generators including nextInt, nextBoolean, nextDouble, and Gaussian sampling. - [System](https://zio.dev/reference/services/system.md): Service providing access to environment variables, system properties, and platform-level information for application configuration. - [Fiber-local State](https://zio.dev/reference/state-management/fiber-local-state.md): Both the `FiberRef` and `ZState` data types are state management tools that are scoped to a certain fiber. Their values are only accessible within ... - [FiberRef: Introduction to Fiber-local Storage](https://zio.dev/reference/state-management/fiberref.md): Fiber-local storage enabling isolated state management and context propagation across concurrent fibers in ZIO. - [Global Shared State Using Ref](https://zio.dev/reference/state-management/global-shared-state.md): Manage global shared state in ZIO applications using Ref, enabling safe concurrent state sharing between fibers. - [Introduction to State Management in ZIO](https://zio.dev/reference/index-13.md): Overview of state management approaches in ZIO, covering recursion, global shared state with Ref, and fiber-local state with FiberRef and ZState. - [State Management Using Recursion](https://zio.dev/reference/state-management/recursion.md): This is a very common pattern to use variables to keep track of the state. For example, to calculate the length of a list, we can store intermediat... - [ThreadLocalBridge](https://zio.dev/reference/state-management/threadlocal-bridge.md): `ThreadLocalBridge` is a **service for synchronizing ZIO fiber-local state with Java `ThreadLocal` storage**. It enables seamless interoperability ... - [ZState](https://zio.dev/reference/state-management/zstate.md): `ZState[S]` models a value of type `S` that can be read from and written to during the execution of an effect. This is a higher-level construct bui... - [Introduction to Software Transactional Memory](https://zio.dev/reference/index-14.md): STM enables composable atomic transactions on memory with atomicity, consistency, and isolation guarantees for concurrent programs. - [STM](https://zio.dev/reference/stm/stm.md.md): STM[E, A] is a transactional effect supporting atomic operations with automatic rollback, error handling, and retry-based composition. - [TArray](https://zio.dev/reference/stm/tarray.md): `TArray` is an array of mutable references that can participate in transactions in STM. - [THub](https://zio.dev/reference/stm/thub.md): A `THub` is a transactional message hub. Publishers can publish messages to the hub and subscribers can subscribe to take messages from the hub. - [TMap](https://zio.dev/reference/stm/tmap.md): A `TMap[A]` is a mutable map that can participate in transactions in STM. - [TPriorityQueue](https://zio.dev/reference/stm/tpriorityqueue.md): A `TPriorityQueue[A]` is a mutable queue that can participate in STM transactions. A `TPriorityQueue` contains values of type `A` for which an `Ord... - [TPromise](https://zio.dev/reference/stm/tpromise.md): `TPromise` is a mutable reference that can be set exactly once and can participate in transactions in STM. - [TQueue](https://zio.dev/reference/stm/tqueue.md): Mutable queue for STM transactions with bounded/unbounded capacity and blocking operations for safe concurrent data sharing. - [TRandom](https://zio.dev/reference/stm/trandom.md): `TRandom` is a random service like [Random](../services/random.md) that provides utilities to generate random numbers, but they can participate in ... - [TReentrantLock](https://zio.dev/reference/stm/treentrantlock.md): A `TReentrantLock` allows safe concurrent access to some mutable state efficiently, allowing multiple fibers to read the - [TRef](https://zio.dev/reference/stm/tref.md): TRef is a mutable reference to immutable values that participates in STM transactions with atomicity, consistency, and isolation guarantees. - [TSemaphore](https://zio.dev/reference/stm/tsemaphore.md): `TSemaphore` is a semaphore with transactional semantics that can be used to control access to a common resource. It - [TSet](https://zio.dev/reference/stm/tset.md): A `TSet[A]` is a mutable set that can participate in transactions in STM. - [Chunk](https://zio.dev/reference/stream/chunk.md): A `Chunk[A]` represents a chunk of values of type `A`. Chunks are usually backed by arrays, but expose a purely functional, safe interface to the u... - [Introduction to ZIO Streams](https://zio.dev/reference/index-15.md): The primary goal of a streaming library is to introduce **a high-level API that abstracts the mechanism of reading and writing operations using dat... - [Installing ZIO Streams](https://zio.dev/reference/stream/installation.md): In order to use ZIO Streaming, we need to add the required configuration in our SBT settings: - [SubscriptionRef](https://zio.dev/reference/stream/subscription-ref.md): A `SubscriptionRef[A]` is a `Ref` that lets us subscribe to receive the current value along with all changes to that value. - [Channel Interruption](https://zio.dev/reference/stream/zchannel/channel-interruption.md): We can interrupt a channel using the `ZChannel.interruptWhen` operator. It takes a ZIO effect that will be evaluated, if it finishes before the cha... - [Channel Operations](https://zio.dev/reference/stream/zchannel/channel-operations.md): The values from the output port of the first channel are passed to the input port of the second channel when we pipe a channel to another channel: - [Composing Channels](https://zio.dev/reference/stream/zchannel/composing-channels.md): We can write more complex channels by using `read` operators and composing them recursively. - [Creating Channels](https://zio.dev/reference/stream/zchannel/creating-channels.md): `ZChannel` have several constructors and also built-in channels, where suitable to create more complex channels. - [Introduction To ZChannels](https://zio.dev/reference/stream/index.md): Channels are the nexus of communications, which support both reading and writing. They allow us to have a unidirectional flow of data from the inpu... - [Running a Channel](https://zio.dev/reference/stream/zchannel/running-a-channel.md): To run a channel, we can use the `ZChannel.runXYZ` methods: - [ZPipeline](https://zio.dev/reference/stream/zpipeline.md): A `ZPipeline[-Env, +Err, -In, +Out]` is a stream transformer. Pipelines accept a stream as input and return the transformed stream as output. - [Parallel Operators](https://zio.dev/reference/stream/zsink/parallel-operators.md): Like `ZStream`, two `ZSink` can be zipped together. Both of them will be run in parallel, and their results will be combined in a tuple: - [Creating Sinks](https://zio.dev/reference/stream/zsink/creating-sinks.md): The `zio.stream` provides numerous kinds of sinks to use. - [Introduction to ZSink](https://zio.dev/reference/stream/index-2.md): A `ZSink[R, E, I, L, Z]` is used to consume elements produced by a [`ZStream`](../zstream/index.md). You can think of a sink as a function that wil... - [Leftovers](https://zio.dev/reference/stream/zsink/leftovers.md): A sink consumes a variable amount of `I` elements (zero or more) from the upstream. If the upstream is finite, we can collect leftover values by ca... - [Sink Operations](https://zio.dev/reference/stream/zsink/operations.md): Having created the sink, we can transform it with provided operations. - [Consuming Streams](https://zio.dev/reference/stream/zstream/consuming-streams.md): ```scala - [Creating ZIO Streams](https://zio.dev/reference/stream/zstream/creating-zio-streams.md): There are several ways to create ZIO Stream. In this section, we are going to enumerate some of the important ways of creating `ZStream`. - [Error Handling](https://zio.dev/reference/stream/zstream/error-handling.md): If we have a stream that may fail, we might need to recover from the failure and run another stream, the `ZStream#orElse` takes another stream, so ... - [Introduction to ZStream](https://zio.dev/reference/stream/index-3.md): A `ZStream[R, E, O]` is a description of a program that, when evaluated, may emit zero or more values of type `O`, may fail with errors of type `E`... - [Operations](https://zio.dev/reference/stream/zstream/operations.md): Tapping is an operation of running an effect on each emission of the ZIO Stream. We can think of `ZStream#tap` as an operation that allows us to ob... - [Resourceful Streams](https://zio.dev/reference/stream/zstream/resourceful-streams.md): Most of the constructors of `ZStream` have a special variant to lift a scoped resource to a Stream (e.g. `ZStream.fromReaderScoped`). By using thes... - [Scheduling](https://zio.dev/reference/stream/zstream/scheduling.md): ZStream scheduling combinators for controlling emission timing and spacing of stream outputs using configurable schedule policies. - [Streams Are Chunked by Default](https://zio.dev/reference/stream/zstream/streams-are-chunked-by-default.md): Every time we are working with streams, we are always working with chunks. There are no streams with individual elements, these streams have always... - [Type Aliases](https://zio.dev/reference/stream/zstream/type-aliases.md): The `ZStream` data type, has two type aliases: - [ConcurrentMap](https://zio.dev/reference/sync/concurrentmap.md): Thread-safe concurrent data structure for atomic key-value pair operations - [ConcurrentSet](https://zio.dev/reference/sync/concurrentset.md): Thread-safe set wrapper using ConcurrentHashMap for concurrent ZIO operations. - [CountdownLatch](https://zio.dev/reference/sync/countdownlatch.md): A synchronization primitive that allows fibers to wait until a set of operations in other fibers complete. - [CyclicBarrier](https://zio.dev/reference/sync/cyclicbarrier.md): Enables multiple fibers to synchronize at a common barrier point that resets cyclically for repeated synchronization cycles. - [Introduction to ZIO's Synchronization Primitives](https://zio.dev/reference/index-16.md): Guide to ZIO's synchronization primitives and concurrent data structures for safely managing shared resources in concurrent environments. - [MVar](https://zio.dev/reference/sync/mvar.md): A single-element mutable buffer that synchronizes concurrent fibers, enabling semaphores, latches, and producer-consumer patterns. - [ReentrantLock](https://zio.dev/reference/sync/reentrantlock.md): Lock mechanism that allows the same fiber to acquire it multiple times with optional fairness policies. - [Annotating Tests](https://zio.dev/reference/test/aspects/annotating-tests.md): We can annotate the execution time of each test using the `timed` test aspect: - [Before, After, and Around Test Aspects](https://zio.dev/reference/test/aspects/before-after-around.md): 1. We can run an effect _before_, _after_, or _around_ every test: - [Conditional Aspects](https://zio.dev/reference/test/aspects/conditional.md): When we apply a conditional aspect, it will run the spec only if the specified predicate is satisfied. - [Configuring Tests](https://zio.dev/reference/test/aspects/configuring-tests.md): To run cases, there are some [default configuration settings](../services/test-config.md) which are used by test runner, such as _repeats_, _retrie... - [Debugging and Diagnostics](https://zio.dev/reference/test/aspects/debugging-and-diagnostics.md): 1. `TestAspect.debug` — When the `TestConsole` is in the debug state, the console output is rendered to the standard output in addition to being wr... - [Environment-specific Tests](https://zio.dev/reference/test/aspects/environment-specific-tests.md): To run a test on a specific operating system, we can use one of the `unix`, `mac` or `windows` test aspects or a combination of them. Additionally,... - [Execution Strategy](https://zio.dev/reference/test/aspects/execution-strategy.md): ZIO Test has two different strategies to run members of a test suite: _sequential_ and _parallel_. Accordingly, there are two test aspects for spec... - [Flaky and Non-flaky Tests](https://zio.dev/reference/test/aspects/flaky-and-non-flaky-tests.md): Whenever we deal with concurrency issues or race conditions, we should ensure that our tests pass consistently. The `nonFlaky` is a test aspect to ... - [Ignoring Tests](https://zio.dev/reference/test/aspects/ignoring-tests.md): To ignore running a test, we can use the `ignore` test aspect: - [Introduction to Test Aspects](https://zio.dev/reference/test/index.md): A `TestAspect` is an aspect that can be weaved into specs. We can think of an aspect as a polymorphic function, capable of transforming one test in... - [Non-deterministic Test Data](https://zio.dev/reference/test/aspects/non-deterministic-test-data.md): The random process of the `TestRandom` is said to be deterministic since, with the initial seed, we can generate a sequence of predictable numbers.... - [Passing Failed Tests](https://zio.dev/reference/test/aspects/passing-failed-tests.md): The `failing` aspect makes a test that failed for any reason pass. - [Repeat and Retry](https://zio.dev/reference/test/aspects/repeat-and-retry.md): Test aspects for repeating tests on a schedule and retrying failures until success with configurable policies. - [Restoring State of Test Services](https://zio.dev/reference/test/aspects/restoring-state-of-test-services.md): ZIO Test has some test aspects which restore the state of given restorable test services, such as `TestClock`, `TestConsole`, `TestRandom` and `Tes... - [Changing the Size of Sized Generators](https://zio.dev/reference/test/aspects/sized.md): To change the default _size_ used by [sized generators](../property-testing/built-in-generators.md#sized-generators) we can use `size` test aspect: - [Timing-out Tests](https://zio.dev/reference/test/aspects/timing-out-tests.md): The `timeout` test aspect takes a duration and times out each test. If the test case runs longer than the time specified, it is immediately cancele... - [Built-in Assertions](https://zio.dev/reference/test/assertions/built-in-assertions.md): Comprehensive reference guide to ZIO Test's built-in assertion functions organized by type for testing values and effects. - [Classic Assertions](https://zio.dev/reference/test/assertions/classic-assertions.md): Traditional assertion methods using assert and assertZIO functions for composing assertions to test values and ZIO effects in ZIO Test. - [Introduction to ZIO Test Assertions](https://zio.dev/reference/test/index-2.md): ZIO Test Assertions framework for composing assertions using logical operations and nested assertions to test values and effects. - [Smart Assertions](https://zio.dev/reference/test/assertions/smart-assertions.md): Smart Assertions enable simple assertions for ordinary values and ZIO effects using the assertTrue macro function with operators and nested value s... - [zio.test.diff.Diff](https://zio.dev/reference/test/zio-test-diff.md): When asserting two things are the same it's sometimes difficult to see the difference. Luckily there is a `zio.test.Diff` type-class. The purpose t... - [Dynamic Test Generation](https://zio.dev/reference/test/dynamic-test-generation.md): Tests in ZIO are dynamic. Meaning that they are not required to be statically defined at compile time. They can be generated at runtime effectfully. - [Introduction to ZIO Test](https://zio.dev/reference/index-17.md): **ZIO Test** is a zero dependency testing library that makes it easy to test effectual programs. In **ZIO Test**, all tests are immutable values an... - [Installing ZIO Test](https://zio.dev/reference/test/installation.md): In order to use ZIO Test, we need to add the required configuration in our SBT settings: - [Integrating ZIO Test with JUnit](https://zio.dev/reference/test/junit-integration.md): Unit testing is an essential practice in software development, enabling developers to validate the correctness and reliability of their code. JUnit... - [Built-in Generators](https://zio.dev/reference/test/property-testing/built-in-generators.md): Comprehensive reference for ZIO Test property-based test generators including primitives, collections, functions, and ZIO effects. - [Getting Started With Property Checking](https://zio.dev/reference/test/property-testing/getting-started.md): Learn to test system properties using random input generators and property predicates with ZIO Test's Gen and check functions. - [How Generators Work?](https://zio.dev/reference/test/property-testing/how-generators-work.md): A `Gen[R, A]` represents a generator of values of type `A`, which requires an environment `R`. The `Gen` data type is the base functionality for ge... - [Introduction To Property Testing](https://zio.dev/reference/test/index-3.md): In property-based testing, instead of testing individual values and making assertions on the results, we rely on testing the properties of the syst... - [Operators](https://zio.dev/reference/test/property-testing/operators.md): 1. `Gen#zipWith` — Composes this generator with the specified generator to create a cartesian product of elements with the specified function: - [Shrinking](https://zio.dev/reference/test/property-testing/shrinking.md): In Property-Based Testing, we specify certain properties of a program, then we ask the testing framework to generate random test data to discover c... - [Running Tests](https://zio.dev/reference/test/running-tests.md): We can run ZIO Tests in two ways: - [TestClock](https://zio.dev/reference/test/services/clock.md): Provides deterministic time control in tests, enabling fast testing of time-dependent effects without waiting for real time. - [TestConsole](https://zio.dev/reference/test/services/console.md): `TestConsole` allows testing of applications that interact with the console by modeling working with standard input and output as writing and readi... - [Introduction](https://zio.dev/reference/test/index-4.md): ZIO Test has out of the box test implementations for all built-in ZIO services, such as `Console`, `Clock`, `Random` and `System` through the follo... - [Live](https://zio.dev/reference/test/services/live.md): The `Live` trait provides access to the _live_ environment from within the test environment for effects such as printing test results to the consol... - [TestRandom](https://zio.dev/reference/test/services/random.md): Supports deterministic testing of randomness using seed-based generation or predefined value feeding for reproducible property-based test scenarios. - [Sized](https://zio.dev/reference/test/services/sized.md): The `Sized` service enables the _Sized Generators_ to access the _size_ from the ZIO Test environment: - [TestSystem](https://zio.dev/reference/test/services/system.md): ZIO Test service for deterministic testing of system environment variables and JVM system properties in isolation. - [TestConfig](https://zio.dev/reference/test/services/config.md): The `TestConfig` service provides access to default configuration settings used by ZIO Test: - [Sharing Layers Between Multiple Files](https://zio.dev/reference/test/sharing-layers-between-multiple-files.md): In the previous example, we used the `Spec#provideXYZShared` methods to share layers between multiple specs in one file. In most cases, when the nu... - [Sharing Layers within the Same File](https://zio.dev/reference/test/sharing-layers-within-the-same-file.md): The `Spec` data type has a mechanism to share layers within all tests in a suite. Instead of acquiring and releasing dependencies for each test, we... - [Spec](https://zio.dev/reference/test/spec.md): Just like the `ZIO` data type, the `Spec` requires an environment of type `R`. When we write tests, we might need to access a service through the e... - [Test Hierarchies and Organization](https://zio.dev/reference/test/test-hierarchies-and-organization.md): A `Spec[R, E]` is the backbone of ZIO Test. All specs require an environment of type `R` and may potentially fail with an error of type `E`. - [Why ZIO Test?](https://zio.dev/reference/test/why-zio-test.md): In this section, we will discuss important features of the ZIO Test which help us to test our effectual code easily. - [Writing Our First Test](https://zio.dev/reference/test/writing-our-first-test.md): Any object that implements the `ZIOSpecDefault` trait is a runnable test. So to start writing tests we need to extend `ZIOSpecDefault`, which requi... - [Compositional FiberRef Updates with Differ](https://zio.dev/guides/compositional-fiberref-updates-with-differ.md): Learn how Differ[Value, Patch] powers compositional, patch-based FiberRef updates that faithfully merge concurrent fiber changes. - [ZIO Guides](https://zio.dev/index-2.md): The following guides have been written to help you get started with ZIO with minimal effort and without the need to fully understand the underlying... - [How to Interop with Cats Effect?](https://zio.dev/guides/interop/with-cats-effect.md): [`interop-cats`](https://github.com/zio/interop-cats) has instances for the [Cats](https://typelevel.org/cats/), [Cats MTL](https://github.com/type... - [How to Interop with Future?](https://zio.dev/guides/interop/with-future.md): Basic interoperability with Scala's `Future` is now provided by ZIO, and does not require a separate module. - [How to Interop with Java?](https://zio.dev/guides/interop/with-java.md): ZIO has full interoperability with foreign Java code. Let me show you how it works and then *BOOM*, tomorrow you can show off your purely functiona... - [How to Interop with JavaScript?](https://zio.dev/guides/interop/with-javascript.md): Include ZIO in your Scala.js project by adding the following to your `build.sbt`: - [How to Migrate From Akka to ZIO?](https://zio.dev/guides/migrate/from-akka.md): Here, we summarized alternative ZIO solutions for Akka Actor features. So before starting the migration, let's see an overview of corresponding fea... - [How to Migrate from Cats Effect to ZIO?](https://zio.dev/guides/migrate/from-cats-effect.md): Cats `IO[A]` can be easily replaced with ZIO's `Task[A]` (an alias for `ZIO[Any, Throwable, A]`). - [How to Migrate from Monix to ZIO?](https://zio.dev/guides/migrate/from-monix.md): Monix's `Task[A]` can be easily replaced with ZIO's `Task[A]` (an alias for `ZIO[Any, Throwable, A]`). - [ZIO 2.x Migration Guide](https://zio.dev/guides/migrate/zio-2.x-migration-guide.md): In this guide we want to introduce the migration process to ZIO 2.x. So if you have a project written in ZIO 1.x and want to migrate that to ZIO 2.... - [ZIO Quickstart: Building GraphQL Web Service](https://zio.dev/guides/quickstarts/graphql-webservice.md): This quickstart shows how to build a GraphQL web service using ZIO. It uses - [ZIO Quickstart: Hello World](https://zio.dev/guides/quickstarts/hello-world.md): Simple introductory guide to creating your first ZIO application using ZIOAppDefault and Console operations for effect composition. - [ZIO Quickstart: Building RESTful Web Service](https://zio.dev/guides/quickstarts/restful-webservice.md): This quickstart shows how to build a RESTful web service using ZIO. It uses - [Tutorial: How to Build a GraphQL Web Service](https://zio.dev/guides/tutorials/build-a-graphql-webservice.md): Having GraphQL APIs enables the clients the ability to query the exact data they need. This powerful feature makes GraphQL more flexible than RESTf... - [Tutorial: How to Build a RESTful Web Service](https://zio.dev/guides/tutorials/build-a-restful-webservice.md): ZIO provides good support for building RESTful web services. Using _Service Pattern_, we can build web services that are modular and easy to test a... - [Tutorial: How to Create a Custom Logger for a ZIO Application?](https://zio.dev/guides/tutorials/create-custom-logger-for-a-zio-application.md): As we have seen in the [previous tutorial](enable-logging-in-a-zio-application.md), ZIO has a variety of built-in logging facilities. Also, it has ... - [Tutorial: How to Debug a ZIO Application?](https://zio.dev/guides/tutorials/debug-a-zio-application.md): Tutorial for debugging ZIO applications using the ZIO.debug effect, print statements, and IDE debuggers for functional effects. - [Tutorial: How to Deploy a ZIO Application Using Docker?](https://zio.dev/guides/tutorials/deploy-a-zio-application-using-docker.md): Docker is a tool that allows us to package, ship, and run our applications in an isolated environment called a container. Using Docker, we can simp... - [Tutorial: How to Enable Logging in a ZIO Application](https://zio.dev/guides/tutorials/enable-logging-in-a-zio-application.md): ZIO has built-in support for logging. This tutorial will show you how to enable logging for a ZIO application. - [Tutorial: How to Encode and Decode JSON Data?](https://zio.dev/guides/tutorials/encode-and-decode-json-data.md): In this article, we will cover how to encode and decode JSON data. - [Getting Started with ThreadLocalBridge](https://zio.dev/guides/tutorials/getting-started-threadlocal-bridge.md): Learn to synchronize ZIO fiber-local state with Java ThreadLocal variables for seamless Java library interoperability. - [Tutorial: How to Gracefully Shutdown ZIO Applications?](https://zio.dev/guides/tutorials/gracefully-shutdown-zio-application.md): Graceful shutdown is a critical aspect of building robust and reliable software applications. It ensures that an application terminates smoothly, a... - [Tutorial: How to Make a ZIO Application Configurable?](https://zio.dev/guides/tutorials/configurable-zio-application.md): One of the most common requirements for writing an application is to be able to configure it, especially when we are writing cloud-native applicati... - [Tutorial: How to Monitor a ZIO Application Using ZIO's Built-in Metric System?](https://zio.dev/guides/tutorials/monitor-a-zio-application-using-zio-built-in-metric-system.md): ZIO has a built-in metric system that allows us to monitor the performance of our application. This is very useful for debugging and tuning our app... - [Tutorial: Hot-Swapping Services with Reloadable](https://zio.dev/guides/tutorials/reloadable-services.md): Welcome! In this tutorial we explore one of ZIO's most compelling runtime features: the ability to **hot-swap a service** while the application kee... - [Schedule Step by Step — Retry and Repeat Policies in ZIO](https://zio.dev/guides/tutorials/retry-and-repeat-policies-with-schedule.md): Learn how ZIO's Schedule works as a pure state machine, and build retry and repeat policies from primitives, composition, and the Driver API. - [Tutorial: How to Run Our First ZIO Project With VSCode?](https://zio.dev/guides/tutorials/run-our-first-zio-project-with-vscode.md): ZIO is a _type-safe_ library for building asynchronous and concurrent applications. The Scala compiler can catch a lot of errors at compile time si... - [Tutorial: How to Run Our First ZIO Project With IntelliJ IDEA?](https://zio.dev/guides/tutorials/run-our-first-zio-project-with-intellij-idea.md): IntelliJ IDEA is a popular IDE for Java developers. It is a powerful tool for developing Java applications. Fortunately, not only does it support t... - [Caliban](https://zio.dev/ecosystem/community/caliban.md): [Caliban](https://ghostdogpr.github.io/caliban/) is a purely functional library for creating GraphQL servers and clients in Scala. - [Distage](https://zio.dev/ecosystem/community/distage.md): [Distage](https://izumi.7mind.io/distage/) is a compile-time safe, transparent, and debuggable Dependency Injection framework for pure FP Scala. - [Fhir-indexer](https://zio.dev/ecosystem/community/fhir-indexer.md): [Fhir-indexer](https://github.com/royashcenazi/fhir-indexer) is a ZIO based library for fetching FHIR resources fast and easy. - [ZIO Ecosystem Community Libraries](https://zio.dev/ecosystem/index.md): In this section we are going to introduce some of the most important libraries that have first-class ZIO support from the community. - [LogStage](https://zio.dev/ecosystem/community/logstage.md): [LogStage](https://izumi.7mind.io/logstage/) is a zero-cost structural logging framework for Scala & Scala.js. - [MUnit ZIO](https://zio.dev/ecosystem/community/munit-zio.md): [MUnit ZIO](https://github.com/poslegm/munit-zio) is an integration library between MUnit and ZIO. - [Rezilience](https://zio.dev/ecosystem/community/rezilience.md): [Rezilience](https://github.com/svroonland/rezilience) is a ZIO-native library for making resilient distributed systems. - [Scala k8s](https://zio.dev/ecosystem/community/scala-k8s.md): [Scala k8s](https://github.com/hnaderi/scala-k8s) is a Kubernetes client, data models and typesafe manifest generation for scala, scalajs, and scal... - [Tamer](https://zio.dev/ecosystem/community/tamer.md): [Tamer](https://github.com/laserdisc-io/tamer) is a multi-functional Kafka connector for producing data based on [ZIO Kafka](https://github.com/zio... - [Tofu ZIO 2 Logging](https://zio.dev/ecosystem/community/tofu-zio2-logging.md): [Tofu](https://docs.tofu.tf/) is a functional toolkit modules providing a comprehensive set of tools adressing - [TranzactIO](https://zio.dev/ecosystem/community/tranzactio.md): [TranzactIO](https://github.com/gaelrenoux/tranzactio) is a ZIO wrapper for some Scala database access libraries, currently for [Doobie](https://gi... - [ZIO AMQP](https://zio.dev/ecosystem/community/zio-amqp.md): [ZIO AMQP](https://github.com/svroonland/zio-amqp) is a ZIO-based AMQP client for Scala. - [ZIO Apache Parquet](https://zio.dev/ecosystem/community/zio-apache-parquet.md): [ZIO Apache Parquet](https://github.com/grouzen/zio-apache-parquet) is a ZIO-powered Apache Parquet library. - [ZIO EclipseStore](https://zio.dev/ecosystem/community/zio-eclipsestore.md): [ZIO EclipseStore](https://github.com/riccardomerolla/zio-eclipsestore) is a ZIO-based library for type-safe, efficient, and boilerplate-free acces... - [ZIO gRPC](https://zio.dev/ecosystem/community/zio-grpc.md): [ZIO-gRPC](https://scalapb.github.io/zio-grpc/) lets us write purely functional gRPC servers and clients. - [ZIO K8s](https://zio.dev/ecosystem/community/zio-k8s.md): [ZIO K8S](https://github.com/coralogix/zio-k8s) is an idiomatic ZIO client for the Kubernetes API. - [ZIO Kinesis](https://zio.dev/ecosystem/community/zio-kinesis.md): [ZIO Kinesis](https://github.com/svroonland/zio-kinesis) is a ZIO-based AWS Kinesis client for Scala. - [ZIO NebulaGraph](https://zio.dev/ecosystem/community/zio-nebula.md): [zio-nebula](https://github.com/nebula-contrib/zio-nebula) is a simple wrapper around [nebula-java](https://github.com/vesoft-inc/nebula-java/) for... - [ZIO Pulsar](https://zio.dev/ecosystem/community/zio-pulsar.md): [ZIO Pulsar](https://github.com/apache/pulsar) is the _Apache Pulsar_ client for Scala with ZIO and ZIO Streams integration. - [ZIO Slick Interop](https://zio.dev/ecosystem/community/zio-slick-interop.md): [ZIO Slick Interop](https://github.com/ScalaConsultants/zio-slick-interop) is a small library, that provides interop between Slick and ZIO. - [ZIO Temporal](https://zio.dev/ecosystem/community/zio-temporal.md): [ZIO Temporal](https://zio-temporal.vhonta.dev/) is a ZIO library for Temporal, a microservice workflow orchestration platform. - [ZIO Test Akka HTTP](https://zio.dev/ecosystem/community/zio-test-akka-http.md): [ZIO Test Akka HTTP](https://github.com/senia-psm/zio-test-akka-http) is an Akka-HTTP Route TestKit for zio-test. - [ZparkIO](https://zio.dev/ecosystem/community/zparkio.md): [ZParkIO](https://github.com/leobenkel/ZparkIO) is a boilerplate framework to use _Spark_ and _ZIO_ together. - [ZIO Compatible Libraries](https://zio.dev/ecosystem/compatible.md): List of ZIO compatible libraries: - [ZIO Ecosystem](https://zio.dev/index-3.md): ZIO has a rich ecosystem of libraries and tools that enhance its capabilities and provide additional functionality. This ecosystem includes librari... - [ZIO Ecosystem Official Libraries](https://zio.dev/ecosystem/index-2.md): Official ZIO libraries are hosted in the [ZIO organization](https://github.com/zio/) on GitHub, and are generally maintained by core contributors t... - [Project Templates](https://zio.dev/ecosystem/templates.md): List of project starters, bootstrap tools or, templates. - [ZIO Tools](https://zio.dev/ecosystem/tools.md): - [ZIO IntelliJ](https://github.com/zio/zio-intellij) — A complementary, community-developed plugin for IntelliJ IDEA, brings enhancements when usi... - [Articles](https://zio.dev/resources/articles.md): :::caution - [Summary](https://zio.dev/index-4.md): ZIO has a huge ecosystem of libraries, tools, talks, tutorials, and more. In this section, we are going to introduce some of the most important ones. - [Projects using ZIO](https://zio.dev/resources/poweredbyzio.md): - [Rudder](https://github.com/normation/rudder) — an example about how to manage error ADT in several sub-projects and specialized sub-domains, and... - [Sample Projects](https://zio.dev/resources/sampleprojects.md): - [GitHub Release Pager with ZIO 2.0](https://github.com/psisoyev/release-pager) by [Pavels Sisojevs](https://github.com/psisoyev) - [Videos](https://zio.dev/resources/videos.md) - [ZIO Events](https://zio.dev/index-5.md): ZIO has a number of events that are organized by the community all around the world. These events are a great way to learn about ZIO, meet other ZI... - [Frequently Answered Questions (FAQ)](https://zio.dev/faq.md): Guidance on encoding contextual values like UserId and CorrelationId in ZIO applications, covering design patterns and the Z prefix convention. - [ZIO Adopters](https://zio.dev/adopters.md): Following is a partial list of companies happily using ZIO in production to craft concurrent applications. - [Compile Time Errors for Handling Combinators](https://zio.dev/can_fail.md): Error handling combinators in ZIO that require CanFail implicit evidence for compile-time safety - [Code of Conduct](https://zio.dev/code-of-conduct.md): Outlines the ZIO project's Code of Conduct, community standards, moderation governance structure, and the role of the Steering Committee and BDFL. - [Coding Guidelines](https://zio.dev/coding-guidelines.md): These are coding guidelines strictly for ZIO contributors working on ZIO projects and not general conventions to be applied by the Scala community ... - [Contributing to The ZIO Documentation](https://zio.dev/contributing-to-documentation.md): A comprehensive guide for contributing to the ZIO documentation, covering editing methods via GitHub and local development, the Markdown-based tool... - [Contributing to the ZIO Ecosystem Projects](https://zio.dev/contributing-to-zio-ecosystem.md): The ZIO ecosystem is provided by a worldwide community, just like the project itself. So if you are reading this page, you can help us to improve t... - [Contributor Guidelines](https://zio.dev/contributor-guidelines.md): Thank you for your interest in contributing to ZIO, which is a small, zero-dependency library for doing type-safe, composable concurrent and asynch... - [Introduction to izumi-reflect](https://zio.dev/index-6.md): > @quote: Looks a bit similar to TypeTag - [ZIO AMQP](https://zio.dev/index-7.md): ZIO AMQP is a ZIO-based wrapper around the RabbitMQ client. It provides a streaming interface to AMQP queues and helps to prevent you from shooting... - [Artifacts](https://zio.dev/zio-aws/artifacts.md): ```scala - [Aspects](https://zio.dev/zio-aws/aspects.md): It is possible to define _aspects_ of type `AwsCallAspect[R]` that can modify the behavior of the AWS client modules. This can be used for example - [Changelog](https://zio.dev/zio-aws/changelog.md): Note: this is a manually maintained list of important changes. Because of having auto-release from CI, this - [Configuration](https://zio.dev/zio-aws/configuration.md): Each _service module_ depends on the `AwsConfig` layer. This layer is responsible for setting up the - [Examples](https://zio.dev/zio-aws/examples.md): The following example uses the ElasticBeanstalk and EC2 APIs to print some info. - [Summary](https://zio.dev/zio-aws/getting-started-2.md): Low-level AWS wrapper for [ZIO](https://zio.dev) for _all_ AWS services using the AWS Java SDK v2. - [HTTP](https://zio.dev/zio-aws/http.md): By default the AWS Java SDK uses _netty_ under the hood to make the HTTP client calls. `zio-aws` defines the http client - [Overview](https://zio.dev/index-8.md): [ZIO AWS](https://zio.dev/zio-aws) is AWS wrapper for [ZIO](https://zio.dev) for _all_ AWS services using the AWS Java SDK v2. - [Migration guide](https://zio.dev/zio-aws/migration-guide.md): There are some major changes compared to the ZIO 1 version (v3.x.x.x and v4.x.x.x). This section contains detailed information about what changed a... - [Wrappers](https://zio.dev/zio-aws/wrappers.md): The live implementation depends on a core _AWS configuration layer_: - [Compile-Time Resource Safety with Scope](https://zio.dev/zio-blocks/guides/compile-time-resource-safety-with-scope.md): Welcome to ZIO Blocks Scope—a library that makes resource management safe, composable, and verifiable at compile time. If you've ever struggled wit... - [Getting Started with Mux](https://zio.dev/zio-blocks/guides/getting-started-with-mux.md): Learn how to manage multiplexed bidirectional message streams with capacity limits. - [Query DSL with Reified Optics — Part 3: Extending the Expression Language](https://zio.dev/zio-blocks/guides/query-dsl-extending.md): In this guide, we will extend the ZIO Blocks query DSL with an expression language that goes beyond what `SchemaExpr` provides out of the box. By t... - [Query DSL with Reified Optics — Part 4: A Fluent SQL Builder](https://zio.dev/zio-blocks/guides/query-dsl-fluent-builder.md): In this guide, we will build a fluent, type-safe SQL statement builder on top of the query expression language from Parts 1–3. By the end, you will... - [Query DSL with Reified Optics — Part 1: Expressions](https://zio.dev/zio-blocks/guides/query-dsl-reified-optics.md): In this guide, we will build a type-safe query DSL for filtering, comparing, and computing over domain data using ZIO Blocks' reified optics and sc... - [Query DSL with Reified Optics — Part 2: SQL Generation](https://zio.dev/zio-blocks/guides/query-dsl-sql.md): In this guide, we will build a SQL query generator that translates ZIO Blocks' `SchemaExpr` expression trees into SQL WHERE clauses, SELECT stateme... - [Telemetry: Architecture, Patterns, and Real-World Usage](https://zio.dev/zio-blocks/guides/telemetry-guide.md): `zio-blocks-telemetry` is an effect-free, zero-allocation observability library that gives you structured logging, distributed tracing, and metrics... - [Migrating from ZIO Schema to ZIO Blocks Schema](https://zio.dev/zio-blocks/guides/zio-schema-migration.md): This guide helps you migrate an application that uses [ZIO Schema](https://github.com/zio/zio-schema) (version 1.x) to [ZIO Blocks Schema](https://... - [ZIO Blocks](https://zio.dev/index-9.md): **Modular, zero-dependency building blocks for modern Scala applications.** - [Config Follow-up PR Plan](https://zio.dev/zio-blocks/plans/config-follow-up-prs.md): This document turns the config assessment roadmap into concrete follow-up PR/issue-sized work items. - [Config PR Assessment and Roadmap](https://zio.dev/zio-blocks/plans/config-pr-assessment-roadmap.md): This document captures the assessment of the current config PR (`feat(config): add config, config-yaml, config-json, config-hocon modules`) and the... - [Async](https://zio.dev/zio-blocks/reference/async.md): The `async` module provides `Async[A]`, a lightweight, zero-dependency - [Chunk](https://zio.dev/zio-blocks/reference/chunk.md): `Chunk[A]` is an **immutable, indexed sequence** of elements of type `A`. Unlike `Array`, `Chunk` provides a purely functional interface with optim... - [CaseClass](https://zio.dev/zio-blocks/reference/codegen/case-class.md): `CaseClass` represents an immutable case class in the IR. Use it when generating Scala code from data models, APIs, or structured data—it's the mos... - [EmitterConfig](https://zio.dev/zio-blocks/reference/codegen/emitter-config.md): `EmitterConfig` controls how `ScalaEmitter` formats Scala code. Customize indentation, import sorting, trailing commas, and target Scala version (2... - [Complete Examples](https://zio.dev/zio-blocks/reference/codegen/examples.md): This page shows complete, runnable examples demonstrating realistic code generation workflows. Each example builds IR models from scratch and emits... - [Field](https://zio.dev/zio-blocks/reference/codegen/field.md): `Field` represents a class field (constructor parameter) in the IR. Combine a name with a type reference, optionally adding default values and modi... - [Code Generation](https://zio.dev/zio-blocks/reference/index.md): `zio-blocks-codegen` is a **generic, domain-agnostic Scala code generation library**. It provides an intermediate representation (IR) for building ... - [ScalaEmitter](https://zio.dev/zio-blocks/reference/codegen/scala-emitter.md): `ScalaEmitter` is the core emission engine that converts IR models to formatted Scala source code. It provides the main entry point and methods to ... - [ScalaFile](https://zio.dev/zio-blocks/reference/codegen/scala-file.md): `ScalaFile` is the root IR node representing a complete Scala source file. It holds everything needed to emit a compilable file: the package declar... - [SealedTrait](https://zio.dev/zio-blocks/reference/codegen/sealed-trait.md): `SealedTrait` represents a sealed trait in the IR—a sum type (algebraic data type) that enumerates all possible cases. It's essential for modeling ... - [TypeDefinition](https://zio.dev/zio-blocks/reference/codegen/type-definition.md): `TypeDefinition` is a sealed trait that represents any Scala type definition—case classes, sealed traits, enums, objects, newtypes, type aliases, a... - [TypeRef](https://zio.dev/zio-blocks/reference/codegen/type-ref.md): `TypeRef` represents a reference to a Scala type in the IR. It captures both simple types (like `String`, `Int`) and generic types (like `List[Stri... - [Combinators](https://zio.dev/zio-blocks/reference/combinators.md): The `combinators` module provides compile-time typeclasses for composing and decomposing values in type-safe ways. Each module focuses on a specifi... - [Config](https://zio.dev/zio-blocks/reference/config.md): `zio.blocks.config` provides typed configuration loading, feature flags, provenance tracking, rollout selection, and source adapters for YAML, JSON... - [Context](https://zio.dev/zio-blocks/reference/context.md): `Context[+R]` is a type-indexed heterogeneous collection that stores values of different types, indexed by their types, with compile-time type safe... - [Datastar](https://zio.dev/zio-blocks/reference/datastar.md): `zio-blocks-datastar` provides a type-safe Scala SDK for [Datastar](https://data-star.dev/), the hypermedia framework that brings reactive UIs via ... - [ZIO Blocks Docs (Markdown)](https://zio.dev/zio-blocks/reference/docs.md): ZIO Blocks Markdown is a **pure, zero-dependency GitHub Flavored Markdown library** providing an immutable ADT for markdown documents, a strict par... - [AuthType](https://zio.dev/zio-blocks/reference/endpoint/auth-type.md): `AuthType` is a sealed trait that describes an HTTP authentication scheme as a first-class type parameter on `Endpoint`. Each `AuthType` variant ca... - [Endpoint](https://zio.dev/zio-blocks/reference/endpoint.md): `Endpoint[PathInput, Input, Err, Output, Auth]` is the top-level descriptor for an HTTP endpoint. It holds a typed route, three independent codec c... - [HttpCodec](https://zio.dev/zio-blocks/reference/endpoint/http-codec.md): `HttpCodec[K, A]` is a composable, typed descriptor for HTTP request and response parts. The phantom type parameter `K` (either `CodecKind.Request`... - [Endpoint (Module)](https://zio.dev/zio-blocks/reference/index-2.md): `zio-blocks-endpoint` is a **pure, type-safe HTTP endpoint descriptor** for building clients, servers, and API documentation from a single source o... - [PathCodec](https://zio.dev/zio-blocks/reference/endpoint/path-codec.md): `PathCodec[A]` is a composable descriptor for URL path structures. It holds a tree of segment codecs connected by concatenation and fallback nodes,... - [RoutePattern](https://zio.dev/zio-blocks/reference/endpoint/route-pattern.md): `RoutePattern[A]` pairs an HTTP method with a typed path pattern. It is the primary routing descriptor in `zio-blocks-endpoint`: every `Endpoint` c... - [RouteTree](https://zio.dev/zio-blocks/reference/endpoint/route-tree.md): `RouteTree[A]` is a routing trie keyed by HTTP method and path. It maps `(Method, Path)` pairs to values of type `A`, performing prefix-tree lookup... - [SegmentCodec](https://zio.dev/zio-blocks/reference/endpoint/segment-codec.md): `SegmentCodec[A]` describes a single URL path segment. It supports basic typed segment kinds — `SegmentCodec.bool`, `SegmentCodec.int`, `SegmentCod... - [HTML](https://zio.dev/zio-blocks/reference/html.md): `zio-blocks-html` is a **type-safe HTML templating library** providing immutable data structures and a fluent DSL for building HTML, CSS, and JavaS... - [Attribute Values and Infrastructure](https://zio.dev/zio-blocks/reference/htmx/attribute-values.md): This section documents supporting attribute value types and infrastructure for the HTMX DSL. These types handle specialized data encoding, configur... - [HxEncoding](https://zio.dev/zio-blocks/reference/htmx/hx-encoding.md): `HxEncoding` represents the `hx-encoding` attribute, controlling how form data is encoded when sent in an HTMX request. The primary use case is fil... - [HxParams](https://zio.dev/zio-blocks/reference/htmx/hx-params.md): `HxParams` represents the `hx-params` attribute, controlling which form parameters are included in the HTMX request. Instead of sending all form fi... - [HxSwap](https://zio.dev/zio-blocks/reference/htmx/hx-swap.md): `HxSwap` represents the `hx-swap` attribute, controlling how HTMX replaces DOM content after a successful response. It combines a base strategy (in... - [HxSync](https://zio.dev/zio-blocks/reference/htmx/hx-sync.md): `HxSync` represents the `hx-sync` attribute, coordinating multiple HTMX requests by specifying how new requests interact with pending or running re... - [HxTarget](https://zio.dev/zio-blocks/reference/htmx/hx-target.md): `HxTarget` represents the `hx-target` attribute and related selector-based attributes, declaring where HTMX applies the swap. It supports DOM trave... - [HxTrigger](https://zio.dev/zio-blocks/reference/htmx/hx-trigger.md): `HxTrigger` represents the `hx-trigger` attribute, declaring which event fires an HTMX request. It combines an event name with optional modifiers t... - [HxUrlUpdate](https://zio.dev/zio-blocks/reference/htmx/hx-url-update.md): `HxUrlUpdate` represents the `hx-push-url` and `hx-replace-url` attributes, controlling whether and how the browser's URL bar updates after an HTMX... - [HTMX](https://zio.dev/zio-blocks/reference/index-3.md): `zio.http.htmx` is a **typed HTMX DSL** for building safe, compile-time HTMX attribute declarations within `zio.blocks.html`. It provides immutable... - [HTTP Model](https://zio.dev/zio-blocks/reference/index-4.md): `zio-http-model` is a **pure, zero-dependency HTTP data model** for building HTTP clients and servers. It provides immutable types representing all... - [HTTP Model](https://zio.dev/zio-blocks/reference/http-model/model.md): `zio-http-model` is a **pure, zero-dependency HTTP data model** for building HTTP clients and servers. It provides immutable types representing all... - [Schema-Based Typed Access](https://zio.dev/zio-blocks/reference/http-model/schema.md): `zio-http-model-schema` adds **type-safe, validated extraction** of query parameters and headers to the core HTTP model. It provides extension meth... - [Maybe](https://zio.dev/zio-blocks/reference/maybe.md): `Maybe[A]` is a **low-allocation alternative to `Option[A]`** that uses `null` to represent the absence of a value. It is an opaque type alias for ... - [MediaType](https://zio.dev/zio-blocks/reference/media-type.md): `MediaType` is a **type-safe representation of IANA media types** (also known as MIME types). It captures structured metadata about content types i... - [Mux](https://zio.dev/zio-blocks/reference/mux.md): `zio-blocks-mux` is a **high-performance multiplexer for ID-multiplexed protocols** (HTTP/2, QUIC, WebSockets with multiplexing, and other stream-b... - [OpenAPI](https://zio.dev/zio-blocks/reference/openapi.md): `zio-blocks-openapi` is a **complete, type-safe OpenAPI 3.1 data model** for building API documentation programmatically. It provides immutable cas... - [DeferHandle](https://zio.dev/zio-blocks/reference/resource-management/defer-handle.md): `DeferHandle` is a handle returned by `Scope.defer` that allows cancelling a registered finalizer before the scope closes: - [Finalization](https://zio.dev/zio-blocks/reference/resource-management/finalization.md): `Finalization` is the result of running all finalizers in a scope, collecting any errors that occurred during cleanup: - [Finalizer](https://zio.dev/zio-blocks/reference/resource-management/finalizer.md): `Finalizer` is a minimal capability interface for registering cleanup actions. It exposes only the `Finalizer#defer` method, preventing code from a... - [Resource Management & Dependency Injection](https://zio.dev/zio-blocks/reference/index-5.md): Resource management and dependency injection are fundamental to building reliable, maintainable applications. ZIO Blocks provides three complementa... - [Resource](https://zio.dev/zio-blocks/reference/resource-management/resource.md): `Resource[A]` is a **lazy recipe for managing resource lifecycles**, encapsulating both acquisition and finalization tied to a `Scope`. Resources d... - [Scope](https://zio.dev/zio-blocks/reference/resource-management/scope.md): `Scope` is a **compile-time safe resource lifecycle manager** that tags allocated values with a scope-specific type, preventing use-after-close at ... - [Unscoped](https://zio.dev/zio-blocks/reference/resource-management/unscoped.md): `Unscoped[A]` is a marker typeclass for types that can safely escape a scope without tracking. Types with an `Unscoped` instance are considered "sa... - [Wire](https://zio.dev/zio-blocks/reference/resource-management/wire.md): `Wire[-In, +Out]` is a **compile-time safe recipe for constructing a service and its dependencies**. Wires describe how to construct an `Out` value... - [Advanced Topics](https://zio.dev/zio-blocks/reference/ringbuffer/advanced.md): Ring buffers are **lock-free** but must be used correctly: - [RingBuffer](https://zio.dev/zio-blocks/reference/index-6.md): Ring buffers are **fixed-size, lock-free queues** for efficiently exchanging elements between producer and consumer threads with minimal contention... - [MPMC RingBuffer](https://zio.dev/zio-blocks/reference/ringbuffer/mpmc.md): `MpmcRingBuffer[A]` is the fully general-purpose implementation for systems with multiple producer and consumer threads. It uses the **Vyukov/Dmitr... - [MPSC RingBuffer](https://zio.dev/zio-blocks/reference/ringbuffer/mpsc.md): `MpscRingBuffer[A]` handles the inverse case: multiple producer threads safely offering elements to a single consumer thread. It uses a **hybrid de... - [SPMC RingBuffer](https://zio.dev/zio-blocks/reference/ringbuffer/spmc.md): `SpmcRingBuffer[A]` allows a single producer thread to efficiently feed multiple consumer threads. It uses an **index-based algorithm** where slot ... - [SPSC RingBuffer](https://zio.dev/zio-blocks/reference/ringbuffer/spsc.md): `SpscRingBuffer[A]` is optimized for the simplest and fastest case: exactly one producer thread and one consumer thread. It uses the **FastFlow** a... - [Allows](https://zio.dev/zio-blocks/reference/schema/allows.md): `Allows[A, S]` is a compile-time capability token that proves, at the call site, that type `A` satisfies the structural grammar `S`. A capability t... - [BindingResolver](https://zio.dev/zio-blocks/reference/schema/binding-resolver.md): `BindingResolver` is the **read-only interface for looking up bindings by type identity** during schema rebinding. Given a type `A`, a resolver sea... - [Binding](https://zio.dev/zio-blocks/reference/schema/binding.md): `Binding` is a sealed trait in ZIO Blocks that provides the operational machinery for constructing and deconstructing values of schema-described ty... - [Avro Codec Module](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/avro.md): `zio-blocks-schema-avro` is a **schema-driven Avro codec module** for serializing and deserializing Scala types to and from Avro binary format. It ... - [BSON Codec Module](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/bson.md): `zio-blocks-schema-bson` is a **schema-driven BSON codec module** for serializing and deserializing Scala types to and from BSON (Binary JSON) form... - [CSV Codec Module](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/csv.md): `zio-blocks-schema-csv` is a **schema-driven CSV codec module** for serializing and deserializing Scala types to and from CSV format. It provides R... - [Built-in Formats and Codecs](https://zio.dev/zio-blocks/reference/schema/index.md): ZIO Blocks Schema provides codec derivation for multiple serialization formats. Once you have a `Schema[A]` for your data type, you can derive code... - [JSON Codec](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/index.md): The JSON codec module provides complete, type-safe support for working with JSON data in ZIO Blocks. It includes an ADT for representing JSON value... - [JSON Configuration](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/json/json-config.md): The JSON codec module provides four configuration types for controlling encoding and decoding behavior: `WriterConfig`, `ReaderConfig`, `MergeStrat... - [JsonDiffer](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/json/json-differ.md): `JsonDiffer` is a **diff algorithm for JSON values** that computes the minimal [`JsonPatch`](./json-patch.md) transforming one `Json` value into an... - [JsonPatch](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/json/json-patch.md): `JsonPatch` is an **untyped, composable patch** for [`Json`](./json.md) values. It represents a sequence of operations that transform one `Json` va... - [JSON Schema](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/json/json-schema.md): `JsonSchema` provides first-class support for [JSON Schema 2020-12](https://json-schema.org/specification-links.html#2020-12) in ZIO Blocks. It ena... - [JsonSelection](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/json/json-selection.md): `JsonSelection` is a fluent wrapper type that enables composable, chainable navigation through JSON structures. It wraps `Either[SchemaError, Chunk... - [Json](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/json.md): `Json` is a type-safe, schema-free representation of JSON values that enables navigation, transformation, merging, and querying without losing fide... - [MessagePack Codec Module](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/messagepack.md): `zio-blocks-schema-messagepack` is a **schema-driven MessagePack codec module** for serializing and deserializing Scala types to and from MessagePa... - [Thrift Codec Module](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/thrift.md): `zio-blocks-schema-thrift` is a **schema-driven Thrift codec module** for serializing and deserializing Scala types to and from Thrift binary forma... - [TOON Codec Module](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/toon.md): `zio-blocks-schema-toon` is a **schema-driven TOON codec module** for serializing and deserializing Scala types to and from TOON format. It provide... - [XML Codec Module](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/xml.md): `Xml` is a **sealed trait representing XML nodes**. It provides a type-safe, immutable representation of all valid XML document structures includin... - [YAML Codec Module](https://zio.dev/zio-blocks/reference/schema/built-in-codecs/yaml.md): `zio-blocks-schema-yaml` is a **schema-driven YAML codec module** for serializing and deserializing Scala types to and from YAML format. It provide... - [Codec](https://zio.dev/zio-blocks/reference/schema/codec.md): `Codec[DecodeInput, EncodeOutput, Value]` is the base abstraction for encoding and decoding values between a specific input representation and a sp... - [DynamicOptic](https://zio.dev/zio-blocks/reference/schema/dynamic-optic.md): `DynamicOptic` is a runtime path through nested data structures in ZIO Blocks. It is the untyped, - [DynamicSchema](https://zio.dev/zio-blocks/reference/schema/dynamic-schema.md): `DynamicSchema` is a **type-erased schema container** that wraps a `Reflect.Unbound[_]` tree — all the structural information from a `Schema[A]` (f... - [DynamicValue](https://zio.dev/zio-blocks/reference/schema/dynamic-value.md): `DynamicValue` is a schema-less, dynamically-typed representation of any structured value in ZIO Blocks. It provides a universal data model that ca... - [Format Type](https://zio.dev/zio-blocks/reference/schema/format.md): A `Format` is an abstraction that bundles together everything needed to serialize and deserialize data in a specific format (JSON, Avro, MessagePac... - [ZIO Blocks Schema](https://zio.dev/zio-blocks/reference/index-7.md): ZIO Blocks Schema is the core type system and serialization framework that provides reified structural metadata for Scala data types. It enables ty... - [Lazy](https://zio.dev/zio-blocks/reference/schema/lazy.md): The `Lazy[A]` data type represents a deferred computation that produces a value of type `A`. Unlike Scala's built-in `lazy val`, ZIO Blocks' `Lazy`... - [Migration](https://zio.dev/zio-blocks/reference/schema/migration.md): `Migration[A, B]` is ZIO Blocks Schema's typed API for evolving data from one schema version to another. It wraps a fully serializable [`DynamicMig... - [Modifier](https://zio.dev/zio-blocks/reference/schema/modifier.md): `Modifier` is a sealed trait that provides a mechanism to attach metadata and configuration to schema elements. Modifiers serve as annotations for ... - [Optics](https://zio.dev/zio-blocks/reference/schema/optics.md): Optics are a fundamental feature of ZIO Blocks that enable type-safe, composable access and modification of nested data structures. What sets ZIO B... - [Patching](https://zio.dev/zio-blocks/reference/schema/patch.md): The Patching system in ZIO Blocks provides a type-safe, serializable way to describe and apply transformations to data structures. Unlike direct mu... - [Path Interpolator](https://zio.dev/zio-blocks/reference/schema/path-interpolator.md): :::note - [Reflect](https://zio.dev/zio-blocks/reference/schema/reflect.md): The `Reflect` data type is the foundational data structure underlying ZIO Blocks. While `Schema[A]` is the user-facing API that wraps a `Reflect`, ... - [Register System](https://zio.dev/zio-blocks/reference/schema/registers.md): The register system is one of the key innovations in ZIO Blocks (ZIO Schema 2) that enables **zero-allocation, box-free construction and deconstruc... - [SchemaError](https://zio.dev/zio-blocks/reference/schema/schema-error.md): `SchemaError` is a **structured error type** for schema operations in ZIO Blocks. It represents one or more validation, conversion, or structural f... - [As](https://zio.dev/zio-blocks/reference/schema/schema-evolution/as.md): `As[A, B]` is a **bidirectional conversion type class** that extends `Into[A, B]` with a reverse direction. In addition to converting `A → B` via `... - [Schema Evolution](https://zio.dev/zio-blocks/reference/schema/index-2.md): Schema evolution is the process of changing data structures over time while keeping existing data readable and systems interoperable. ZIO Blocks pr... - [Into](https://zio.dev/zio-blocks/reference/schema/schema-evolution/into.md): `Into[-A, +B]` is a **one-way conversion type class** that converts values of type `A` into values of type `B`, returning `Either[SchemaError, B]` ... - [SchemaExpr](https://zio.dev/zio-blocks/reference/schema/schema-expr.md): `SchemaExpr[A, B]` is a **schema-aware expression** that computes a result of type `B` from an input value of type `A`. It is invariant in both typ... - [Schema](https://zio.dev/zio-blocks/reference/schema/schema.md): `Schema[A]` is the primary data type in ZIO Blocks (ZIO Schema 2) that contains reified information about the structure of a Scala data type `A`, t... - [Structural Types](https://zio.dev/zio-blocks/reference/schema/structural-types.md):