@zio.dev/zio-blocks 0.0.30 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,7 +52,7 @@ Since `SchemaExpr` is a sealed trait, you cannot add new cases to it. Instead, w
52
52
  This guide builds on [Part 1: Expressions](./query-dsl-reified-optics.md) and [Part 2: SQL Generation](./query-dsl-sql.md). You should be comfortable building `SchemaExpr` values and translating them to SQL.
53
53
 
54
54
  ```scala
55
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
55
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
56
56
  ```
57
57
 
58
58
  ```scala
@@ -57,7 +57,7 @@ In this guide, we solve both problems: bridge extensions eliminate `.toExpr`, an
57
57
  This guide builds on [Part 1: Expressions](./query-dsl-reified-optics.md), [Part 2: SQL Generation](./query-dsl-sql.md), and [Part 3: Extending the Expression Language](./query-dsl-extending.md).
58
58
 
59
59
  ```scala
60
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
60
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
61
61
  ```
62
62
 
63
63
  ## Domain Setup
@@ -43,7 +43,7 @@ In this guide, we'll solve this by using ZIO Blocks' `SchemaExpr` and reified op
43
43
  Add the ZIO Blocks Schema dependency:
44
44
 
45
45
  ```scala
46
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
46
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
47
47
  ```
48
48
 
49
49
  ```scala
@@ -43,7 +43,7 @@ Since `SchemaExpr` is a sealed trait, we can write a single interpreter that tra
43
43
  This guide builds on [Part 1: Expressions](./query-dsl-reified-optics.md). You should be comfortable building `SchemaExpr` values with optic operators (`===`, `>`, `&&`, etc.).
44
44
 
45
45
  ```scala
46
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
46
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
47
47
  ```
48
48
 
49
49
  ```scala
@@ -38,13 +38,13 @@ libraryDependencies += "dev.zio" %% "zio-schema-avro" % "1.x.x"
38
38
  **After (ZIO Blocks Schema):**
39
39
 
40
40
  ```scala
41
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
41
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
42
42
  // Optional codec modules:
43
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.30"
44
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.30"
45
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.30"
46
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.30"
47
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.30"
43
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.32"
44
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.32"
45
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.32"
46
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.32"
47
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.32"
48
48
  ```
49
49
 
50
50
  Key points:
@@ -536,7 +536,7 @@ val protoCodec: BinaryCodec[Person] = ProtobufCodec.protobufCodec(Person.schema)
536
536
  // ZIO Blocks Schema — all codecs via schema.derive(Format); return type inferred
537
537
  import zio.blocks.schema._
538
538
  import zio.blocks.schema.json.JsonFormat
539
- val jsonCodec = Person.schema.derive(JsonFormat) // inferred: JsonBinaryCodec[Person]
539
+ val jsonCodec = Person.schema.derive(JsonFormat) // inferred: JsonCodec[Person]
540
540
 
541
541
  import zio.blocks.schema.avro.AvroFormat
542
542
  val avroCodec = Person.schema.derive(AvroFormat)
@@ -593,7 +593,7 @@ val codec = JsonCodec.jsonCodec(Person.schema) // returns zio.json.JsonCodec
593
593
 
594
594
  // ZIO Blocks Schema — built into zio-blocks-schema; no extra dependency
595
595
  import zio.blocks.schema.json.JsonFormat
596
- val codec = Person.schema.derive(JsonFormat) // returns JsonBinaryCodec[Person]
596
+ val codec = Person.schema.derive(JsonFormat) // returns JsonCodec[Person]
597
597
  ```
598
598
 
599
599
  ### Streaming Codecs
package/index.md CHANGED
@@ -82,14 +82,14 @@ val thriftCodec = Schema[Person].derive(ThriftFormat) // Thrift
82
82
  ### Installation
83
83
 
84
84
  ```scala
85
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
85
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
86
86
 
87
87
  // Optional format modules:
88
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.30"
89
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.30"
90
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.30"
91
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.30"
92
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.30"
88
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.32"
89
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.32"
90
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.32"
91
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.32"
92
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.32"
93
93
  ```
94
94
 
95
95
  ### Example: Optics
@@ -144,7 +144,7 @@ Chunk is designed for:
144
144
  ### Installation
145
145
 
146
146
  ```scala
147
- libraryDependencies += "dev.zio" %% "zio-blocks-chunk" % "0.0.30"
147
+ libraryDependencies += "dev.zio" %% "zio-blocks-chunk" % "0.0.32"
148
148
  ```
149
149
 
150
150
  ### Example
@@ -233,7 +233,7 @@ Scope.global.scoped { scope =>
233
233
  ### Installation
234
234
 
235
235
  ```scala
236
- libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.30"
236
+ libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.32"
237
237
  ```
238
238
 
239
239
  ### Example: Basic Resource Management
@@ -342,7 +342,7 @@ Generating documentation, README files, or any Markdown content programmatically
342
342
  ### Installation
343
343
 
344
344
  ```scala
345
- libraryDependencies += "dev.zio" %% "zio-blocks-docs" % "0.0.30"
345
+ libraryDependencies += "dev.zio" %% "zio-blocks-docs" % "0.0.32"
346
346
  ```
347
347
 
348
348
  ### Example
@@ -426,7 +426,7 @@ Compile-time type identity with rich metadata. TypeId captures comprehensive inf
426
426
  ### Installation
427
427
 
428
428
  ```scala
429
- libraryDependencies += "dev.zio" %% "zio-blocks-typeid" % "0.0.30"
429
+ libraryDependencies += "dev.zio" %% "zio-blocks-typeid" % "0.0.32"
430
430
  ```
431
431
 
432
432
  ### Example
@@ -469,7 +469,7 @@ A type-indexed heterogeneous collection that stores values by their types with c
469
469
  ### Installation
470
470
 
471
471
  ```scala
472
- libraryDependencies += "dev.zio" %% "zio-blocks-context" % "0.0.30"
472
+ libraryDependencies += "dev.zio" %% "zio-blocks-context" % "0.0.32"
473
473
  ```
474
474
 
475
475
  ### Example
@@ -521,7 +521,7 @@ Standard `java.util.concurrent` queues use node allocation (`ConcurrentLinkedQue
521
521
  ### Installation
522
522
 
523
523
  ```scala
524
- libraryDependencies += "dev.zio" %% "zio-blocks-ringbuffer" % "0.0.30"
524
+ libraryDependencies += "dev.zio" %% "zio-blocks-ringbuffer" % "0.0.32"
525
525
  ```
526
526
 
527
527
  ### Example
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@zio.dev/zio-blocks",
3
3
  "description": "ZIO Blocks Documentation",
4
4
  "license": "Apache-2.0",
5
- "version": "0.0.30",
5
+ "version": "0.0.32",
6
6
  "repository": {
7
7
  "url": "https://github.com/zio/zio-blocks"
8
8
  }
@@ -19,7 +19,7 @@ abstract class Codec[DecodeInput, EncodeOutput, Value] {
19
19
  - **`encode`** writes the encoded form of `value` into `output`. The output parameter is typically a mutable buffer (`ByteBuffer`, `CharBuffer`) that the caller provides.
20
20
  - **`decode`** reads from `input` and returns either a `SchemaError` describing the failure or the decoded value.
21
21
 
22
- End users rarely interact with `Codec` directly. Instead, they work with format-specific subclasses like `JsonBinaryCodec[A]` or `ToonBinaryCodec[A]`, which add convenience methods for common input/output types.
22
+ End users rarely interact with `Codec` directly. Instead, they work with format-specific subclasses like `JsonCodec[A]` or `ToonCodec[A]`, which add convenience methods for common input/output types.
23
23
 
24
24
  Given a `Schema[A]`, you can derive a codec for any supported format by calling `Schema[A].derive(format)`, which uses the `Deriver` associated with that format to generate the appropriate codec instance. For example, to derive a JSON codec:
25
25
 
@@ -32,8 +32,8 @@ case class Person(name: String, age: Int)
32
32
  object Person {
33
33
  // Derive a schema for Person (required for codec derivation)
34
34
  implicit val schema: Schema[Person] = Schema.derived
35
- // Derive a JSON codec from the schema
36
- implicit val codec: JsonBinaryCodec[Person] = schema.derive(JsonFormat)
35
+ // Derive a JSON codec from the schema
36
+ val codec: JsonCodec[Person] = schema.derive(JsonFormat)
37
37
  }
38
38
 
39
39
  // Encode
@@ -48,23 +48,26 @@ val result: Either[SchemaError, Person] = Person.codec.decode(bytes)
48
48
  To include the base schema module with JSON support, add the following dependency to your `build.sbt`:
49
49
 
50
50
  ```scala
51
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
51
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
52
52
  ```
53
53
 
54
54
  Additional format modules are separate artifacts:
55
55
 
56
56
  ```scala
57
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.30"
58
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.30"
59
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.30"
60
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.30"
61
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.30"
57
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.32"
58
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.32"
59
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-csv" % "0.0.32"
60
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.32"
61
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.32"
62
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.32"
63
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-xml" % "0.0.32"
64
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-yaml" % "0.0.32"
62
65
  ```
63
66
 
64
67
  For cross-platform projects (Scala.js):
65
68
 
66
69
  ```scala
67
- libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.30"
70
+ libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.32"
68
71
  ```
69
72
 
70
73
  Supported Scala versions: 2.13.x and 3.x.
@@ -76,12 +79,15 @@ The codec system in ZIO Blocks is organized as a layered hierarchy:
76
79
  ```
77
80
  Codec[DecodeInput, EncodeOutput, Value]
78
81
  ├── BinaryCodec[A] = Codec[ByteBuffer, ByteBuffer, A] (ByteBuffer ↔ A)
79
- │ ├── JsonBinaryCodec[A]
80
- │ ├── AvroBinaryCodec[A]
81
- │ ├── ToonBinaryCodec[A]
82
- │ ├── ThriftBinaryCodec[A]
83
- │ └── MessagePackBinaryCodec[A]
82
+ │ ├── AvroCodec[A]
83
+ │ ├── JsonCodec[A]
84
+ │ ├── MessagePackCodec[A]
85
+ │ ├── ThriftCodec[A]
86
+ │ ├── ToonCodec[A]
87
+ │ ├── XmlCodec[A]
88
+ │ └── YamlCodec[A]
84
89
  └── TextCodec[A] = Codec[CharBuffer, CharBuffer, A] (CharBuffer ↔ A)
90
+ └── CsvCodec[A]
85
91
  ```
86
92
 
87
93
  1. **`BinaryCodec[A]`** fixes both the input and output to `ByteBuffer` and is the base class for all codecs that operate on binary data:
@@ -116,7 +122,7 @@ object Person {
116
122
  }
117
123
 
118
124
  // Pass a Format object to get a codec for that format
119
- val jsonCodec: JsonBinaryCodec[Person] = Schema[Person].derive(JsonFormat)
125
+ val jsonCodec: JsonCodec[Person] = Schema[Person].derive(JsonFormat)
120
126
  ```
121
127
 
122
128
  This works with any format:
@@ -151,12 +157,12 @@ object Person extends CompanionOptics[Person] {
151
157
  }
152
158
 
153
159
  // Override the codec for the "name" field
154
- val customNameCodec = new JsonBinaryCodec[String] {
160
+ val customNameCodec = new JsonCodec[String] {
155
161
  def decodeValue(in: JsonReader): String = in.readString()
156
162
  def encodeValue(x: String, out: JsonWriter): Unit = out.writeVal(x.toUpperCase)
157
163
  }
158
164
 
159
- val codec: JsonBinaryCodec[Person] = Schema[Person]
165
+ val codec: JsonCodec[Person] = Schema[Person]
160
166
  .deriving(JsonFormat.deriver)
161
167
  .instance(Person.name, customNameCodec)
162
168
  .derive
@@ -207,11 +213,11 @@ Passing a `Deriver` directly is useful when working with custom or configured de
207
213
 
208
214
  ## Convenience Methods on Format-Specific Codecs
209
215
 
210
- While the base `Codec` class defines only `encode(value, output)` and `decode(input)`, format-specific subclasses like `JsonBinaryCodec` and `ToonBinaryCodec` add convenience overloads for common I/O types.
216
+ While the base `Codec` class defines only `encode(value, output)` and `decode(input)`, format-specific subclasses like `JsonCodec` and `ToonCodec` add convenience overloads for common I/O types.
211
217
 
212
- ### JsonBinaryCodec Convenience Methods
218
+ ### JsonCodec Convenience Methods
213
219
 
214
- `JsonBinaryCodec[A]` provides the following overloads beyond the base `ByteBuffer` API:
220
+ `JsonCodec[A]` provides the following overloads beyond the base `ByteBuffer` API:
215
221
 
216
222
  ```scala
217
223
  import zio.blocks.schema._
@@ -244,9 +250,9 @@ val is = new ByteArrayInputStream(os.toByteArray)
244
250
  val fromStream: Either[SchemaError, Person] = codec.decode(is)
245
251
  ```
246
252
 
247
- ### ToonBinaryCodec Convenience Methods
253
+ ### ToonCodec Convenience Methods
248
254
 
249
- `ToonBinaryCodec[A]` provides the same set of overloads:
255
+ `ToonCodec[A]` provides the same set of overloads:
250
256
 
251
257
  ```scala
252
258
  import zio.blocks.schema._
@@ -307,7 +313,7 @@ object Person {
307
313
  implicit val schema: Schema[Person] = Schema.derived
308
314
  }
309
315
 
310
- val customDeriver = JsonBinaryCodecDeriver
316
+ val customDeriver = JsonCodecDeriver
311
317
  .withFieldNameMapper(NameMapper.SnakeCase)
312
318
  .withTransientNone(true)
313
319
  .withRejectExtraFields(true)
@@ -348,7 +354,7 @@ object Person {
348
354
  implicit val schema: Schema[Person] = Schema.derived
349
355
  }
350
356
 
351
- val customDeriver = ToonBinaryCodecDeriver
357
+ val customDeriver = ToonCodecDeriver
352
358
  .withFieldNameMapper(NameMapper.SnakeCase)
353
359
  .withArrayFormat(ArrayFormat.Tabular)
354
360
  .withDiscriminatorKind(DiscriminatorKind.Field("type"))
@@ -365,11 +371,13 @@ import zio.blocks.schema._
365
371
  import zio.blocks.schema.json._
366
372
 
367
373
  case class Address(street: String, city: String)
368
- case class Person(name: String, address: Address)
369
374
 
370
375
  object Address {
371
376
  implicit val schema: Schema[Address] = Schema.derived
372
377
  }
378
+
379
+ case class Person(name: String, address: Address)
380
+
373
381
  object Person {
374
382
  implicit val schema: Schema[Person] = Schema.derived
375
383
  }
@@ -116,7 +116,7 @@ val config = ctx.get[Config] // Compile-time proof it exists
116
116
  Add the ZIO Blocks Context module to your `build.sbt`:
117
117
 
118
118
  ```scala
119
- libraryDependencies += "dev.zio" %% "zio-blocks-context" % "0.0.30"
119
+ libraryDependencies += "dev.zio" %% "zio-blocks-context" % "0.0.32"
120
120
  ```
121
121
 
122
122
  ## Construction
@@ -525,6 +525,22 @@ cd zio-blocks
525
525
  **Context construction: creating contexts with apply, empty.add, and inspecting size/isEmpty/nonEmpty**
526
526
 
527
527
  ```scala title="schema-examples/src/main/scala/context/ContextConstructionExample.scala"
528
+ /*
529
+ * Copyright 2024-2026 John A. De Goes and the ZIO Contributors
530
+ *
531
+ * Licensed under the Apache License, Version 2.0 (the "License");
532
+ * you may not use this file except in compliance with the License.
533
+ * You may obtain a copy of the License at
534
+ *
535
+ * http://www.apache.org/licenses/LICENSE-2.0
536
+ *
537
+ * Unless required by applicable law or agreed to in writing, software
538
+ * distributed under the License is distributed on an "AS IS" BASIS,
539
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
540
+ * See the License for the specific language governing permissions and
541
+ * limitations under the License.
542
+ */
543
+
528
544
  package context
529
545
 
530
546
  import zio.blocks.context._
@@ -586,6 +602,22 @@ sbt "schema-examples/runMain context.ContextConstructionExample"
586
602
  **Context retrieval: using get, supertype lookups, and getOption for safe access**
587
603
 
588
604
  ```scala title="schema-examples/src/main/scala/context/ContextRetrievalExample.scala"
605
+ /*
606
+ * Copyright 2024-2026 John A. De Goes and the ZIO Contributors
607
+ *
608
+ * Licensed under the Apache License, Version 2.0 (the "License");
609
+ * you may not use this file except in compliance with the License.
610
+ * You may obtain a copy of the License at
611
+ *
612
+ * http://www.apache.org/licenses/LICENSE-2.0
613
+ *
614
+ * Unless required by applicable law or agreed to in writing, software
615
+ * distributed under the License is distributed on an "AS IS" BASIS,
616
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
617
+ * See the License for the specific language governing permissions and
618
+ * limitations under the License.
619
+ */
620
+
589
621
  package context
590
622
 
591
623
  import zio.blocks.context._
@@ -655,6 +687,22 @@ sbt "schema-examples/runMain context.ContextRetrievalExample"
655
687
  **Context modification: adding values, updating existing ones, merging contexts, and pruning types**
656
688
 
657
689
  ```scala title="schema-examples/src/main/scala/context/ContextModificationExample.scala"
690
+ /*
691
+ * Copyright 2024-2026 John A. De Goes and the ZIO Contributors
692
+ *
693
+ * Licensed under the Apache License, Version 2.0 (the "License");
694
+ * you may not use this file except in compliance with the License.
695
+ * You may obtain a copy of the License at
696
+ *
697
+ * http://www.apache.org/licenses/LICENSE-2.0
698
+ *
699
+ * Unless required by applicable law or agreed to in writing, software
700
+ * distributed under the License is distributed on an "AS IS" BASIS,
701
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
702
+ * See the License for the specific language governing permissions and
703
+ * limitations under the License.
704
+ */
705
+
658
706
  package context
659
707
 
660
708
  import zio.blocks.context._
package/reference/docs.md CHANGED
@@ -10,7 +10,7 @@ Complete API reference for the zio-blocks-docs module - a zero-dependency GitHub
10
10
  ## Installation
11
11
 
12
12
  ```scala
13
- libraryDependencies += "dev.zio" %% "zio-blocks-docs" % "0.0.30"
13
+ libraryDependencies += "dev.zio" %% "zio-blocks-docs" % "0.0.32"
14
14
  ```
15
15
 
16
16
  ## Core Types
@@ -83,7 +83,7 @@ dynamic
83
83
  // value = Primitive(
84
84
  // primitiveType = String(None),
85
85
  // typeId = String,
86
- // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@5b27ced8,
86
+ // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@6cfd3324,
87
87
  // doc = Doc(blocks = IndexedSeq(), metadata = Map()),
88
88
  // modifiers = List(),
89
89
  // storedDefaultValue = None,
@@ -97,7 +97,7 @@ dynamic
97
97
  // value = Primitive(
98
98
  // primitiveType = Int(None),
99
99
  // typeId = Int,
100
- // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@5b27ced8,
100
+ // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@6cfd3324,
101
101
  // doc = Doc(blocks = IndexedSeq(), metadata = Map()),
102
102
  // modifiers = List(),
103
103
  // storedDefaultValue = None,
@@ -115,7 +115,7 @@ dynamic
115
115
  // value = Primitive(
116
116
  // primitiveType = String(None),
117
117
  // typeId = String,
118
- // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@5b27ced8,
118
+ // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@6cfd3324,
119
119
  // doc = Doc(blocks = IndexedSeq(), metadata = Map()),
120
120
  // modifiers = List(),
121
121
  // storedDefaultValue = None,
@@ -34,23 +34,27 @@ abstract class BinaryFormat[...](...) extends Format { ... }
34
34
  abstract class TextFormat[...](...) extends Format { ... }
35
35
  ```
36
36
 
37
- For example, the `JsonFormat` is a `BinaryFormat` that represents a JSON binary format, where the input for decoding is `ByteBuffer` and the output for encoding is also `ByteBuffer`, the MIME type is `application/json`, and the deriver for generating codecs from schemas is `JsonBinaryCodecDeriver`:
37
+ For example, the `JsonFormat` is a `BinaryFormat` that represents a JSON binary format, where the input for decoding is `ByteBuffer` and the output for encoding is also `ByteBuffer`, the MIME type is `application/json`, and the deriver for generating codecs from schemas is `JsonCodecDeriver`:
38
38
 
39
39
  ```scala
40
- object JsonFormat extends BinaryFormat("application/json", JsonBinaryCodecDeriver)
40
+ object JsonFormat extends BinaryFormat("application/json", JsonCodecDeriver)
41
41
  ```
42
42
 
43
43
  ## Built-in Formats
44
44
 
45
45
  Here's a summary of the formats currently supported by ZIO Blocks. Each format provides a `BinaryFormat` object that can be passed to `derive`:
46
46
 
47
- | Format Object | Codec Type | MIME Type | Module |
48
- |---------------------|-----------------------------|-----------------------|---------------------------------|
49
- | `JsonFormat` | `JsonBinaryCodec[A]` | `application/json` | `zio-blocks-schema` |
50
- | `ToonFormat` | `ToonBinaryCodec[A]` | `text/toon` | `zio-blocks-schema-toon` |
51
- | `MessagePackFormat` | `MessagePackBinaryCodec[A]` | `application/msgpack` | `zio-blocks-schema-messagepack` |
52
- | `AvroFormat` | `AvroBinaryCodec[A]` | `application/avro` | `zio-blocks-schema-avro` |
53
- | `ThriftFormat` | `ThriftBinaryCodec[A]` | `application/thrift` | `zio-blocks-schema-thrift` |
47
+ | Format Object | Codec Type | MIME Type | Module |
48
+ |---------------------|-----------------------|-----------------------|---------------------------------|
49
+ | `JsonFormat` | `JsonCodec[A]` | `application/json` | `zio-blocks-schema` |
50
+ | `AvroFormat` | `AvroCodec[A]` | `application/avro` | `zio-blocks-schema-avro` |
51
+ | `BsonFormat` | `BsonCodec[A]` | `application/bson` | `zio-blocks-schema-bson` |
52
+ | `CsvFormat` | `CsvCodec[A]` | `text/csv` | `zio-blocks-schema-csv` |
53
+ | `MessagePackFormat` | `MessagePackCodec[A]` | `application/msgpack` | `zio-blocks-schema-messagepack` |
54
+ | `ThriftFormat` | `ThriftCodec[A]` | `application/thrift` | `zio-blocks-schema-thrift` |
55
+ | `ToonFormat` | `ToonCodec[A]` | `text/toon` | `zio-blocks-schema-toon` |
56
+ | `XmlFormat` | `XmlCodec[A]` | `application/xml` | `zio-blocks-schema-xml` |
57
+ | `YamlFormat` | `YamlCodec[A]` | `application/yaml` | `zio-blocks-schema-yaml` |
54
58
 
55
59
  ## Defining a Custom Format
56
60
 
@@ -120,15 +124,9 @@ object Person {
120
124
  implicit val schema: Schema[Person] = Schema.derived
121
125
  }
122
126
 
123
- // Using JsonEncoder/JsonDecoder
124
- val jsonEncoder = JsonEncoder[Person]
125
- val jsonDecoder = JsonDecoder[Person]
126
-
127
127
  val person = Person("Alice", 30)
128
- val json: Json = jsonEncoder.encode(person)
129
- // {"name":"Alice","age":30}
130
-
131
- val decoded: Either[SchemaError, Person] = jsonDecoder.decode(json)
128
+ val bytes: Array[Byte] = person.toJsonBytes
129
+ val decoded: Either[SchemaError, Person] = bytes.fromJson[Person]
132
130
  ```
133
131
 
134
132
  ## Avro Format
@@ -168,7 +166,7 @@ val decoded: Either[SchemaError, Person] = codec.decode(bytes)
168
166
 
169
167
  ### Avro Schema Generation
170
168
 
171
- Each `AvroBinaryCodec` exposes an `avroSchema` property containing the Apache Avro schema:
169
+ Each `AvroCodec` exposes an `avroSchema` property containing the Apache Avro schema:
172
170
 
173
171
  ```scala
174
172
  import zio.blocks.schema._
@@ -314,7 +312,7 @@ orders[2]{id,total}:
314
312
 
315
313
  ### Configuration Options
316
314
 
317
- The `ToonBinaryCodecDeriver` provides extensive configuration:
315
+ The `ToonCodecDeriver` provides extensive configuration:
318
316
 
319
317
  ```scala
320
318
  import zio.blocks.schema._
@@ -326,7 +324,7 @@ object Person {
326
324
  }
327
325
 
328
326
  // Custom deriver with snake_case field names
329
- val customDeriver = ToonBinaryCodecDeriver
327
+ val customDeriver = ToonCodecDeriver
330
328
  .withFieldNameMapper(NameMapper.SnakeCase)
331
329
  .withArrayFormat(ArrayFormat.Tabular)
332
330
  .withDiscriminatorKind(DiscriminatorKind.Field("type"))
@@ -368,7 +366,7 @@ val keyCodec = Schema[Shape].derive(ToonFormat)
368
366
  // radius: 5
369
367
 
370
368
  // Field discriminator
371
- val fieldDeriver = ToonBinaryCodecDeriver
369
+ val fieldDeriver = ToonCodecDeriver
372
370
  .withDiscriminatorKind(DiscriminatorKind.Field("type"))
373
371
  val fieldCodec = Schema[Shape].derive(fieldDeriver)
374
372
  // type: Circle
@@ -51,9 +51,9 @@ jsonSchema.conforms(valid) // true
51
51
  jsonSchema.conforms(invalid) // false
52
52
  ```
53
53
 
54
- ### Through JsonBinaryCodec
54
+ ### Through JsonCodec
55
55
 
56
- For more control, derive through `JsonBinaryCodec`:
56
+ For more control, derive through `JsonCodec`:
57
57
 
58
58
  ```scala
59
59
  import zio.blocks.schema._
package/reference/json.md CHANGED
@@ -531,69 +531,62 @@ val normalized = json.normalize
531
531
 
532
532
  ## Encoding and Decoding
533
533
 
534
- ### Type Classes
535
-
536
- ZIO Blocks provides `JsonEncoder` and `JsonDecoder` type classes for converting between Scala types and `Json`:
534
+ ### Built-in Codecs
537
535
 
538
536
  ```scala
539
- import zio.blocks.schema.json.{Json, JsonEncoder, JsonDecoder}
537
+ import zio.blocks.schema.Schema
540
538
 
541
- // Encode Scala values to Json
542
- val intJson = JsonEncoder[Int].encode(42) // Json.Number(42)
543
- val strJson = JsonEncoder[String].encode("hello") // Json.String("hello")
539
+ // Primitives
540
+ Schema[String].jsonCodec
541
+ Schema[Int].jsonCodec
542
+ Schema[Long].jsonCodec
543
+ Schema[Double].jsonCodec
544
+ Schema[Boolean].jsonCodec
545
+ Schema[BigDecimal].jsonCodec
544
546
 
545
- // Decode Json to Scala values
546
- val intResult = JsonDecoder[Int].decode(Json.Number(42)) // Right(42)
547
- val strResult = JsonDecoder[String].decode(Json.String("hello")) // Right("hello")
547
+ // Collections
548
+ Schema[List[Int]].jsonCodec
549
+ Schema[Vector[String]].jsonCodec
550
+ Schema[Map[String, Int]].jsonCodec
551
+ Schema[Option[String]].jsonCodec
552
+
553
+ // Java time/util types
554
+ Schema[java.time.Instant].jsonCodec
555
+ Schema[java.time.LocalDate].jsonCodec
556
+ Schema[java.time.ZonedDateTime].jsonCodec
557
+ Schema[java.util.UUID].jsonCodec
548
558
  ```
549
559
 
550
- ### Built-in Encoders/Decoders
560
+ ### Encoding/Decoding of Primitives
551
561
 
552
562
  ```scala
553
- import zio.blocks.schema.json.{JsonEncoder, JsonDecoder}
554
-
555
- // Primitives
556
- JsonEncoder[String]
557
- JsonEncoder[Int]
558
- JsonEncoder[Long]
559
- JsonEncoder[Double]
560
- JsonEncoder[Boolean]
561
- JsonEncoder[BigDecimal]
563
+ import zio.blocks.schema._
562
564
 
563
- // Collections
564
- JsonEncoder[List[Int]]
565
- JsonEncoder[Vector[String]]
566
- JsonEncoder[Map[String, Int]]
567
- JsonEncoder[Option[String]]
565
+ // Encode Scala values to Json
566
+ val intJson = 42.toJson // Json.Number(42)
567
+ val strJson = "hello".toJson // Json.String("hello")
568
568
 
569
- // Java time types
570
- JsonEncoder[java.time.Instant]
571
- JsonEncoder[java.time.LocalDate]
572
- JsonEncoder[java.time.ZonedDateTime]
573
- JsonEncoder[java.util.UUID]
569
+ // Decode Json to Scala values
570
+ val intResult = intJson.as[Int] // Right(42)
571
+ val strResult = strJson.as[String] // Right("hello")
574
572
  ```
575
573
 
576
- ### Schema-Based Derivation
574
+ ### Encoding/Decoding of Case Classes
577
575
 
578
576
  For complex types, use Schema-based derivation:
579
577
 
580
578
  ```scala
581
- import zio.blocks.schema.Schema
582
- import zio.blocks.schema.json.{Json, JsonEncoder, JsonDecoder}
579
+ import zio.blocks.schema._
583
580
 
584
581
  case class Person(name: String, age: Int)
585
582
 
586
583
  object Person {
587
584
  implicit val schema: Schema[Person] = Schema.derived
588
-
589
- // Derived from schema (lower priority)
590
- implicit val encoder: JsonEncoder[Person] = JsonEncoder.fromSchema
591
- implicit val decoder: JsonDecoder[Person] = JsonDecoder.fromSchema
592
585
  }
593
586
 
594
587
  val person = Person("Alice", 30)
595
- val json = JsonEncoder[Person].encode(person)
596
- val decoded = JsonDecoder[Person].decode(json)
588
+ val json = person.toJson
589
+ val decoded = json.as[Person]
597
590
  ```
598
591
 
599
592
  ### Extension Syntax
@@ -631,14 +624,12 @@ These extension methods provide a more ergonomic API compared to explicitly crea
631
624
  ### Using the `as` Method
632
625
 
633
626
  ```scala
634
- import zio.blocks.schema.json.Json
635
- import zio.blocks.schema.json.JsonDecoder
636
- import zio.blocks.schema.{Schema, SchemaError}
627
+ import zio.blocks.schema._
628
+ import zio.blocks.schema.json._
637
629
 
638
630
  case class Person(name: String, age: Int)
639
631
  object Person {
640
632
  implicit val schema: Schema[Person] = Schema.derived
641
- implicit val decoder: JsonDecoder[Person] = JsonDecoder.fromSchema
642
633
  }
643
634
 
644
635
  val json = Json.parseUnsafe("""{"name": "Alice", "age": 30}""")
@@ -75,13 +75,13 @@ textAny.matches(html) // true
75
75
  Add the following to your `build.sbt`:
76
76
 
77
77
  ```scala
78
- libraryDependencies += "dev.zio" %% "zio-blocks-mediatype" % "0.0.30"
78
+ libraryDependencies += "dev.zio" %% "zio-blocks-mediatype" % "0.0.32"
79
79
  ```
80
80
 
81
81
  For cross-platform projects (Scala.js):
82
82
 
83
83
  ```scala
84
- libraryDependencies += "dev.zio" %%% "zio-blocks-mediatype" % "0.0.30"
84
+ libraryDependencies += "dev.zio" %%% "zio-blocks-mediatype" % "0.0.32"
85
85
  ```
86
86
 
87
87
  Supported Scala versions: 2.13.x and 3.x.
@@ -38,9 +38,9 @@ object User extends CompanionOptics[User] {
38
38
  .derived[User]
39
39
  .modifier(Modifier.config("db.table-name", "users"))
40
40
 
41
- implicit val jsonCodec: JsonBinaryCodec[User] =
41
+ implicit val jsonCodec: JsonCodec[User] =
42
42
  schema
43
- .deriving(JsonBinaryCodecDeriver)
43
+ .deriving(JsonCodecDeriver)
44
44
  .modifier(User.name, Modifier.rename("username"))
45
45
  .modifier(User.cache, Modifier.transient())
46
46
  .derive
@@ -86,9 +86,9 @@ object User extends CompanionOptics[User] {
86
86
  implicit val schema: Schema[User] =
87
87
  Schema.derived[User]
88
88
 
89
- implicit val jsonCodec: JsonBinaryCodec[User] =
89
+ implicit val jsonCodec: JsonCodec[User] =
90
90
  schema
91
- .derive(JsonBinaryCodecDeriver)
91
+ .derive(JsonCodecDeriver)
92
92
  }
93
93
  ```
94
94
 
@@ -36,13 +36,13 @@ Without Resources, managing complex initialization and cleanup is tedious and er
36
36
  Add the ZIO Blocks Scope module to your `build.sbt`:
37
37
 
38
38
  ```scala
39
- libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.30"
39
+ libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.32"
40
40
  ```
41
41
 
42
42
  For cross-platform (Scala.js):
43
43
 
44
44
  ```scala
45
- libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.30"
45
+ libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.32"
46
46
  ```
47
47
 
48
48
  Supported Scala versions: 2.13.x and 3.x.
@@ -55,7 +55,7 @@ If you've used `try/finally`, `Using`, or ZIO's `Scope`, this is the same proble
55
55
  Add the following dependency to your `build.sbt`:
56
56
 
57
57
  ```scala
58
- libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.30"
58
+ libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.32"
59
59
  ```
60
60
 
61
61
  Supported Scala versions: **2.13.x** and **3.x**.
@@ -92,13 +92,13 @@ Scope.global.scoped { scope =>
92
92
  Add the following dependency to your `build.sbt`:
93
93
 
94
94
  ```scala
95
- libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.30"
95
+ libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.32"
96
96
  ```
97
97
 
98
98
  For cross-platform (Scala.js):
99
99
 
100
100
  ```scala
101
- libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.30"
101
+ libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.32"
102
102
  ```
103
103
 
104
104
  Supported Scala versions: 2.13.x and 3.x.
@@ -535,6 +535,22 @@ cd zio-blocks
535
535
  Basic wire construction demonstrates how to create and use `Wire` for dependency injection. View the example source code:
536
536
 
537
537
  ```scala title="scope-examples/src/main/scala/wire/WireBasicExample.scala"
538
+ /*
539
+ * Copyright 2024-2026 John A. De Goes and the ZIO Contributors
540
+ *
541
+ * Licensed under the Apache License, Version 2.0 (the "License");
542
+ * you may not use this file except in compliance with the License.
543
+ * You may obtain a copy of the License at
544
+ *
545
+ * http://www.apache.org/licenses/LICENSE-2.0
546
+ *
547
+ * Unless required by applicable law or agreed to in writing, software
548
+ * distributed under the License is distributed on an "AS IS" BASIS,
549
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
550
+ * See the License for the specific language governing permissions and
551
+ * limitations under the License.
552
+ */
553
+
538
554
  package wire
539
555
 
540
556
  import zio.blocks.scope._
@@ -638,6 +654,22 @@ sbt "scope-examples/runMain wire.wireBasicExample"
638
654
  Comparing shared vs unique semantics shows how shared wires reuse the same instance across dependents, while unique wires create fresh instances. View the example:
639
655
 
640
656
  ```scala title="scope-examples/src/main/scala/wire/WireSharedUniqueExample.scala"
657
+ /*
658
+ * Copyright 2024-2026 John A. De Goes and the ZIO Contributors
659
+ *
660
+ * Licensed under the Apache License, Version 2.0 (the "License");
661
+ * you may not use this file except in compliance with the License.
662
+ * You may obtain a copy of the License at
663
+ *
664
+ * http://www.apache.org/licenses/LICENSE-2.0
665
+ *
666
+ * Unless required by applicable law or agreed to in writing, software
667
+ * distributed under the License is distributed on an "AS IS" BASIS,
668
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
669
+ * See the License for the specific language governing permissions and
670
+ * limitations under the License.
671
+ */
672
+
641
673
  package wire
642
674
 
643
675
  import zio.blocks.scope._
@@ -743,6 +775,22 @@ sbt "scope-examples/runMain wire.wireSharedUniqueExample"
743
775
  Manual wire construction demonstrates how to use `fromFunction` for custom construction logic. View the example:
744
776
 
745
777
  ```scala title="scope-examples/src/main/scala/wire/WireFromFunctionExample.scala"
778
+ /*
779
+ * Copyright 2024-2026 John A. De Goes and the ZIO Contributors
780
+ *
781
+ * Licensed under the Apache License, Version 2.0 (the "License");
782
+ * you may not use this file except in compliance with the License.
783
+ * You may obtain a copy of the License at
784
+ *
785
+ * http://www.apache.org/licenses/LICENSE-2.0
786
+ *
787
+ * Unless required by applicable law or agreed to in writing, software
788
+ * distributed under the License is distributed on an "AS IS" BASIS,
789
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
790
+ * See the License for the specific language governing permissions and
791
+ * limitations under the License.
792
+ */
793
+
746
794
  package wire
747
795
 
748
796
  import zio.blocks.scope._
@@ -539,7 +539,6 @@ Path annotation (`atField`, `atIndex`, `atKey`, `atCase`) builds a [`DynamicOpti
539
539
  ```scala
540
540
  import zio.blocks.schema.{DynamicOptic, DynamicValue, Schema, SchemaError}
541
541
 
542
- implicit val intSchema: Schema[Int] = Schema[Int]
543
542
  val data = DynamicValue.Sequence(DynamicValue.int(1), DynamicValue.int(2))
544
543
  val optic = DynamicOptic.root.at(10)
545
544
 
@@ -39,13 +39,13 @@ The bidirectional data flow looks like this:
39
39
  `As` is part of `zio-blocks-schema`:
40
40
 
41
41
  ```scala
42
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
42
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
43
43
  ```
44
44
 
45
45
  For Scala.js and Scala Native, use `%%%`:
46
46
 
47
47
  ```scala
48
- libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.30"
48
+ libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.32"
49
49
  ```
50
50
 
51
51
  Supported Scala versions: 2.13.x and 3.x.
@@ -240,7 +240,7 @@ trait As[A, B] {
240
240
 
241
241
  ```scala
242
242
  val revAs: As[LongBox, IntBox] = boxAs.reverse
243
- // revAs: As[LongBox, IntBox] = zio.blocks.schema.As$$anon$1@c044a8b
243
+ // revAs: As[LongBox, IntBox] = zio.blocks.schema.As$$anon$1@4bdeb475
244
244
 
245
245
  revAs.into(LongBox(5L))
246
246
  // res11: Either[SchemaError, IntBox] = Right(IntBox(5))
@@ -302,7 +302,7 @@ We import `As.reverseInto` and use it to obtain the reverse `Into[Int, String]`:
302
302
  import As.reverseInto
303
303
 
304
304
  val intToStr: Into[Int, String] = reverseInto[String, Int]
305
- // intToStr: Into[Int, String] = zio.blocks.schema.AsLowPriorityImplicits$$Lambda$17407/0x00007f6106975350@5d23723e
305
+ // intToStr: Into[Int, String] = zio.blocks.schema.AsLowPriorityImplicits$$Lambda$17666/0x00007fd5f2a55c70@497d9813
306
306
  intToStr.into(42)
307
307
  // res14: Either[SchemaError, String] = Right("42")
308
308
  ```
@@ -69,13 +69,13 @@ Compare this to a manual implementation:
69
69
  `Into` is part of the `zio-blocks-schema` module:
70
70
 
71
71
  ```scala
72
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
72
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
73
73
  ```
74
74
 
75
75
  For Scala.js:
76
76
 
77
77
  ```scala
78
- libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.30"
78
+ libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.32"
79
79
  ```
80
80
 
81
81
  Supported Scala versions: 2.13.x and 3.x.
@@ -70,13 +70,13 @@ val result: Either[OpticCheck, Seq[Boolean]] = combined.eval(alice)
70
70
  ## Installation
71
71
 
72
72
  ```scala
73
- libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.30"
73
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.32"
74
74
  ```
75
75
 
76
76
  For cross-platform (Scala.js):
77
77
 
78
78
  ```scala
79
- libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.30"
79
+ libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.32"
80
80
  ```
81
81
 
82
82
  Supported Scala versions: 2.13.x and 3.x.
@@ -173,8 +173,6 @@ ZIO Blocks provides specialized `Option` schemas optimized for primitive types.
173
173
  ```scala
174
174
  import zio.blocks.schema.Schema
175
175
 
176
- import zio.blocks.schema.Schema
177
-
178
176
  // Specialized primitive options (no boxing overhead)
179
177
  Schema[Option[Boolean]] // Also: Byte, Short, Int, Long, Float, Double, Char, Unit
180
178
  ```
@@ -193,12 +191,19 @@ Schema[Option[A]] // Generic option for reference types
193
191
  ZIO Blocks also provides polymorphic schemas for standard Scala collections. You can summon schemas for collections of any element type `A` (and key/value types `K`/`V` for maps):
194
192
 
195
193
  ```scala
194
+ import zio.blocks.schema.Schema
195
+
196
+ // Built-in Scala collections
196
197
  Schema[List[A]] // Immutable singly-linked list
197
198
  Schema[Vector[A]] // Immutable indexed sequence (efficient random access)
198
199
  Schema[Set[A]] // Immutable set (unique elements)
199
200
  Schema[Seq[A]] // General immutable sequence
200
201
  Schema[IndexedSeq[A]] // Indexed sequence
201
202
  Schema[Map[K, V]] // Immutable key-value mapping
203
+
204
+ // ZIO Blocks collections (the chunk module)
205
+ Schema[zio.blocks.chunk.Chunk[A]] // Chunk sequence
206
+ Schema[zio.blocks.chunk.ChunkMap[K, V]] // ChunkMap key-value mapping
202
207
  ```
203
208
 
204
209
  To learn how to create custom collection schemas, check out the [`Sequence`](./reflect.md#3-sequence) and [`Map`](./reflect.md#4-map) nodes on the documentation of [`Reflect`](./reflect.md) data type.
@@ -358,13 +363,13 @@ In the following example, we derive a JSON codec for the `Person` case class usi
358
363
 
359
364
  ```scala
360
365
  import zio.blocks.schema.Schema
361
- import zio.blocks.schema.json.{JsonFormat, JsonBinaryCodec}
366
+ import zio.blocks.schema.json.{JsonFormat, JsonCodec}
362
367
 
363
368
  case class Person(name: String, age: Int)
364
369
 
365
370
  object Person {
366
371
  implicit val schema: Schema[Person] = Schema.derived
367
- val codec: JsonBinaryCodec[Person] = schema.derive(JsonFormat)
372
+ val codec: JsonCodec[Person] = schema.derive(JsonFormat)
368
373
  }
369
374
 
370
375
  val person = Person("John", 42)
@@ -15,7 +15,7 @@ Consider a typical application with 50 domain types that needs 4 type classes (J
15
15
 
16
16
  Each instance requires understanding both the type's structure and the type class's semantics, then correctly implementing encoding, decoding, or whatever operation is required. This quickly becomes unmanageable as the codebase grows.
17
17
 
18
- Assume we have a simple `JsonCodec` type class for JSON serialization and deserialization:
18
+ Assume we have a simple `JsonTC` type class for JSON serialization and deserialization:
19
19
 
20
20
  ```scala
21
21
  import zio.blocks.schema.json._
@@ -28,7 +28,7 @@ case class ParseError(details: String)
28
28
  case class DecodeError(details: String, path: String)
29
29
  extends JsonError(s"Decode Error at '$path': $details")
30
30
 
31
- trait JsonCodec[A] {
31
+ trait JsonTC[A] {
32
32
  def encode(a: A): Json
33
33
  def decode(j: Json): Either[JsonError, A]
34
34
  }
@@ -40,8 +40,8 @@ A single manual codec for a simple type like `Person` looks like the following c
40
40
  case class Person(name: String, age: Int)
41
41
 
42
42
  object Person {
43
- implicit val personCodec: JsonCodec[Person] =
44
- new JsonCodec[Person] {
43
+ implicit val personCodec: JsonTC[Person] =
44
+ new JsonTC[Person] {
45
45
  def encode(c: Person): Json = Json.obj(
46
46
  "name" -> Json.str(c.name),
47
47
  "age" -> Json.number(c.age)
@@ -132,11 +132,11 @@ case class Schema[A](reflect: Reflect.Bound[A]) {
132
132
  }
133
133
  ```
134
134
 
135
- It takes a `Deriver[TC]` as a parameter and returns a type class instance of type `TC[A]`. For example, in the following code snippet, we derive a `JsonBinaryCodec[Person]` instance for the `Person` case class using the `JsonBinaryCodecDeriver`:
135
+ It takes a `Deriver[TC]` as a parameter and returns a type class instance of type `TC[A]`. For example, in the following code snippet, we derive a `JsonCodec[Person]` instance for the `Person` case class using the `JsonCodecDeriver`:
136
136
 
137
137
  ```scala
138
138
  import zio.blocks.schema._
139
- import zio.blocks.schema.json.JsonBinaryCodecDeriver
139
+ import zio.blocks.schema.json.JsonCodecDeriver
140
140
 
141
141
  case class Person(name: String, age: Int)
142
142
 
@@ -144,8 +144,7 @@ object Person {
144
144
  implicit val schema: Schema[Person] = Schema.derived[Person]
145
145
  }
146
146
 
147
- val jsonCodec: JsonBinaryCodec[Person] =
148
- Person.schema.derive(JsonBinaryCodecDeriver)
147
+ val jsonCodec: JsonCodec[Person] = Person.schema.derive(JsonCodecDeriver)
149
148
 
150
149
  val result: Either[SchemaError, Person] =
151
150
  jsonCodec.decode(
@@ -1456,7 +1455,7 @@ Now we can use the derived `Gen[Person]` instance to generate random `Person` va
1456
1455
 
1457
1456
  ```scala
1458
1457
  val random = new Random(42) // Seeded for reproducible output
1459
- // random: Random = scala.util.Random@2dde62c7
1458
+ // random: Random = scala.util.Random@195c6b05
1460
1459
 
1461
1460
  Person.gen.generate(random)
1462
1461
  // res14: Person = Person(name = "p", age = -1360544799)
@@ -1831,8 +1830,8 @@ object User extends CompanionOptics[User] {
1831
1830
  Now we can derive a JSON codec with custom modifiers, renaming fields and marking one as transient, without changing the schema itself:
1832
1831
 
1833
1832
  ```scala
1834
- val jsonCodec: JsonBinaryCodec[User] = User.schema
1835
- .deriving(JsonBinaryCodecDeriver)
1833
+ val jsonCodec: JsonCodec[User] = User.schema
1834
+ .deriving(JsonCodecDeriver)
1836
1835
  .modifier(User.name, Modifier.rename("full_name"))
1837
1836
  .modifier(User.email, Modifier.alias("mail"))
1838
1837
  .modifier(User.internalScore, Modifier.transient())
@@ -1861,8 +1860,8 @@ new String(jsonCodec.encode(user), "UTF-8")
1861
1860
  The `modifier` method with `TypeId` allows you to add a `Modifier.Reflect` to all schema nodes of a given type. This is useful for attaching format-specific configuration metadata to all occurrences of a type:
1862
1861
 
1863
1862
  ```scala
1864
- val jsonCodec: JsonBinaryCodec[User] = User.schema
1865
- .deriving(JsonBinaryCodecDeriver)
1863
+ val jsonCodec: JsonCodec[User] = User.schema
1864
+ .deriving(JsonCodecDeriver)
1866
1865
  .modifier(TypeId.of[User], Modifier.config("json", "camelCase"))
1867
1866
  .modifier(User.internalScore, Modifier.transient())
1868
1867
  .derive
@@ -1873,8 +1872,8 @@ val jsonCodec: JsonBinaryCodec[User] = User.schema
1873
1872
  The `modifier` method with `TypeId` and `termName` allows you to add a `Modifier.Term` to a specific field or case identified by name inside a parent type identified by its `TypeId`. This is useful when you want to target a specific term without constructing an optic for it. The `typeId` refers to the parent record/variant type that owns the term. If no term with the given name exists in the parent type, the modifier is silently ignored:
1874
1873
 
1875
1874
  ```scala
1876
- val jsonCodec: JsonBinaryCodec[User] = User.schema
1877
- .deriving(JsonBinaryCodecDeriver)
1875
+ val jsonCodec: JsonCodec[User] = User.schema
1876
+ .deriving(JsonCodecDeriver)
1878
1877
  .modifier(User.schema.reflect.typeId, "name", Modifier.rename("full_name"))
1879
1878
  .modifier(User.schema.reflect.typeId, "internalScore", Modifier.transient())
1880
1879
  .derive
package/reference/xml.md CHANGED
@@ -942,9 +942,9 @@ All standard ZIO Blocks Schema types are supported:
942
942
  - Options (`Option[A]`)
943
943
  - Wrappers (newtypes)
944
944
 
945
- ## XmlBinaryCodec
945
+ ## XmlCodec
946
946
 
947
- `XmlBinaryCodec[A]` is the low-level codec interface that bridges Schema definitions with XML serialization. While usually derived automatically, you can work with it directly:
947
+ `XmlCodec[A]` is the low-level codec interface that bridges Schema definitions with XML serialization. While usually derived automatically, you can work with it directly:
948
948
 
949
949
  ```scala
950
950
  import zio.blocks.schema._
@@ -956,8 +956,7 @@ object Person {
956
956
  }
957
957
 
958
958
  // Get the underlying binary codec
959
- val codec: XmlBinaryCodec[Person] =
960
- Schema[Person].derive(XmlBinaryCodecDeriver)
959
+ val codec: XmlCodec[Person] = Schema[Person].derive(XmlCodecDeriver)
961
960
 
962
961
  // Encode to Xml directly
963
962
  val person = Person("Alice", 30)
@@ -967,7 +966,7 @@ val xml: Xml = codec.encodeValue(person)
967
966
  val decoded: Either[XmlError, Person] = codec.decodeValue(xml)
968
967
  ```
969
968
 
970
- **XmlBinaryCodec supports all Schema types:**
969
+ **XmlCodec supports all Schema types:**
971
970
  - Primitives (Int, String, Boolean, etc.)
972
971
  - Java time types (Instant, LocalDate, Duration, etc.)
973
972
  - Records (case classes with field-level configuration)
package/ringbuffer.md CHANGED
@@ -25,7 +25,7 @@ All variants expose `offer` (returns `false` if full) and `take` (returns `null`
25
25
  ## Installation
26
26
 
27
27
  ```scala
28
- libraryDependencies += "dev.zio" %% "zio-blocks-ringbuffer" % "0.0.30"
28
+ libraryDependencies += "dev.zio" %% "zio-blocks-ringbuffer" % "0.0.32"
29
29
  ```
30
30
 
31
31
  ---
@@ -59,7 +59,7 @@ These are core public API types that users interact with directly. Each needs a
59
59
  **schema module — JSON subsystem:**
60
60
  - [ ] **`Keyable`** — Type class for JSON key support. Referenced in 5 files. **Scope: new section in json.md**. Source: `schema/shared/src/main/scala/zio/blocks/schema/json/Keyable.scala`
61
61
  - [ ] **`NameMapper`** (`CamelCase`, `KebabCase`, `PascalCase`) — Public field name transformations. **Scope: new section in json.md**. Source: `schema/shared/src/main/scala/zio/blocks/schema/json/NameMapper.scala`
62
- - [ ] **`JsonBinaryCodecError`** — Custom exception for JSON codec errors. Referenced in 7 files. **Scope: brief section in json.md**. Source: `schema/shared/src/main/scala/zio/blocks/schema/json/JsonBinaryCodecError.scala`
62
+ - [ ] **`JsonCodecError`** — Custom exception for JSON codec errors. Referenced in 7 files. **Scope: brief section in json.md**. Source: `schema/shared/src/main/scala/zio/blocks/schema/json/JsonCodecError.scala`
63
63
 
64
64
  **typeid module:**
65
65
  - [ ] **`TypeRepr`** — Central type representation (24 subtypes: ThisType, TypeLambda, Singleton, Repeated, etc.). Referenced across 4-8 files each. **Scope: new section in typeid.md**. Source: `typeid/shared/src/main/scala/zio/blocks/typeid/TypeRepr.scala`
@@ -74,8 +74,8 @@ These are core public API types that users interact with directly. Each needs a
74
74
 
75
75
  **Format codec modules:**
76
76
  - [ ] **`BsonEncoder` / `BsonDecoder` / `BsonCodec`** (schema-bson) — Core encoding/decoding types for BSON. **Scope: expand formats.md BSON section**. Source: `schema-bson/src/main/scala/zio/blocks/schema/bson/BsonTypes.scala`
77
- - [ ] **`MessagePackBinaryCodec`** (schema-messagepack) — Public codec for MessagePack. **Scope: expand formats.md MessagePack section**. Source: `schema-messagepack/src/main/scala/zio/blocks/schema/msgpack/MessagePackBinaryCodec.scala`
78
- - [ ] **`ThriftBinaryCodec`** (schema-thrift) — Public codec for Thrift. **Scope: expand formats.md Thrift section**. Source: `schema-thrift/src/main/scala/zio/blocks/schema/thrift/ThriftBinaryCodec.scala`
77
+ - [ ] **`MessagePackCodec`** (schema-messagepack) — Public codec for MessagePack. **Scope: expand formats.md MessagePack section**. Source: `schema-messagepack/src/main/scala/zio/blocks/schema/msgpack/MessagePackCodec.scala`
78
+ - [ ] **`ThriftCodec`** (schema-thrift) — Public codec for Thrift. **Scope: expand formats.md Thrift section**. Source: `schema-thrift/src/main/scala/zio/blocks/schema/thrift/ThriftCodec.scala`
79
79
  - [ ] **`ToonReader` / `ToonWriter`** (schema-toon) — Public codec for TOON. Referenced in 9-10 files. **Scope: expand formats.md TOON section**. Source: `schema-toon/src/main/scala/zio/blocks/schema/toon/`
80
80
 
81
81
  **markdown module:**
@@ -244,7 +244,7 @@ Internal types that don't need documentation.
244
244
  | `Registry` / `Registry.Entry` | schema | Internal binding resolver storage |
245
245
  | `ObjectIdSupport` | schema-bson | Internal BSON ObjectId helper |
246
246
  | `BsonBuilder` / `BsonTrace` / `EncoderContext` / `BsonDecoderContext` | schema-bson | Internal codec implementation |
247
- | `MessagePackBinaryCodecDeriver` | schema-messagepack | Internal deriver |
247
+ | `MessagePackCodecDeriver` | schema-messagepack | Internal deriver |
248
248
  | `MessagePackReader` / `MessagePackWriter` | schema-messagepack | Internal binary readers/writers |
249
249
  | `Mixed` / `UniformRecords` | schema-toon | Internal codec strategy types |
250
250
  | `ArrayHeader` | schema-toon | Internal reader state |
@@ -313,8 +313,8 @@ Ordered TODO checklist grouped by module, with estimated scope.
313
313
  ### Format modules (expand `formats.md`)
314
314
 
315
315
  26. - [ ] Expand **BSON section** in `formats.md` with BsonEncoder/BsonDecoder API — *update existing*
316
- 27. - [ ] Expand **MessagePack section** in `formats.md` with MessagePackBinaryCodec API — *update existing*
317
- 28. - [ ] Expand **Thrift section** in `formats.md` with ThriftBinaryCodec API — *update existing*
316
+ 27. - [ ] Expand **MessagePack section** in `formats.md` with MessagePackCodec API — *update existing*
317
+ 28. - [ ] Expand **Thrift section** in `formats.md` with ThriftCodec API — *update existing*
318
318
  29. - [ ] Expand **TOON section** in `formats.md` with ToonReader/ToonWriter, Delimiter, config — *update existing*
319
319
 
320
320
  ### Depth improvements (existing pages)