@zio.dev/zio-blocks 0.0.31 → 0.0.33

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.31"
55
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
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.31"
60
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
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.31"
46
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
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.31"
46
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
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.31"
41
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
42
42
  // Optional codec modules:
43
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.31"
44
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.31"
45
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.31"
46
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.31"
47
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.31"
43
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.33"
44
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.33"
45
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.33"
46
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.33"
47
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.33"
48
48
  ```
49
49
 
50
50
  Key points:
package/index.md CHANGED
@@ -5,7 +5,7 @@ title: "ZIO Blocks"
5
5
 
6
6
  **Modular, zero-dependency building blocks for modern Scala applications.**
7
7
 
8
- [![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-blocks/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-blocks-next-schema_3.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-blocks-next-schema_3/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-blocks-next-schema_3.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-blocks-next-schema_3/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-blocks-docs_3/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-blocks-docs_3) [![ZIO Blocks](https://img.shields.io/github/stars/zio/zio-blocks?style=social)](https://github.com/zio/zio-blocks)
8
+ [![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-blocks/workflows/CI/badge.svg) [![ZIO Blocks](https://img.shields.io/github/stars/zio/zio-blocks?style=social)](https://github.com/zio/zio-blocks)
9
9
 
10
10
  ## What Is ZIO Blocks?
11
11
 
@@ -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.31"
85
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
86
86
 
87
87
  // Optional format modules:
88
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.31"
89
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.31"
90
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.31"
91
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.31"
92
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.31"
88
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.33"
89
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.33"
90
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.33"
91
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.33"
92
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.33"
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.31"
147
+ libraryDependencies += "dev.zio" %% "zio-blocks-chunk" % "0.0.33"
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.31"
236
+ libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.33"
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.31"
345
+ libraryDependencies += "dev.zio" %% "zio-blocks-docs" % "0.0.33"
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.31"
429
+ libraryDependencies += "dev.zio" %% "zio-blocks-typeid" % "0.0.33"
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.31"
472
+ libraryDependencies += "dev.zio" %% "zio-blocks-context" % "0.0.33"
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.31"
524
+ libraryDependencies += "dev.zio" %% "zio-blocks-ringbuffer" % "0.0.33"
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.31",
5
+ "version": "0.0.33",
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 `JsonCodec[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: JsonCodec[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.31"
51
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
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.31"
58
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.31"
59
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.31"
60
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.31"
61
- libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.31"
57
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-avro" % "0.0.33"
58
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-bson" % "0.0.33"
59
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-csv" % "0.0.33"
60
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-messagepack" % "0.0.33"
61
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-thrift" % "0.0.33"
62
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-toon" % "0.0.33"
63
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-xml" % "0.0.33"
64
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema-yaml" % "0.0.33"
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.31"
70
+ libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.33"
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)
82
+ │ ├── AvroCodec[A]
79
83
  │ ├── JsonCodec[A]
80
- │ ├── AvroBinaryCodec[A]
81
- │ ├── ToonBinaryCodec[A]
82
- │ ├── ThriftBinaryCodec[A]
83
- │ └── MessagePackBinaryCodec[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:
@@ -207,7 +213,7 @@ 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 `JsonCodec` 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
218
  ### JsonCodec Convenience Methods
213
219
 
@@ -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._
@@ -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.31"
119
+ libraryDependencies += "dev.zio" %% "zio-blocks-context" % "0.0.33"
120
120
  ```
121
121
 
122
122
  ## Construction
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.31"
13
+ libraryDependencies += "dev.zio" %% "zio-blocks-docs" % "0.0.33"
14
14
  ```
15
15
 
16
16
  ## Core Types
@@ -77,13 +77,13 @@ We can inspect the schema's structure by printing it:
77
77
  dynamic
78
78
  // res1: DynamicSchema = DynamicSchema(
79
79
  // Record(
80
- // fields = Vector(
80
+ // fields = IndexedSeq(
81
81
  // Term(
82
82
  // name = "name",
83
83
  // value = Primitive(
84
84
  // primitiveType = String(None),
85
85
  // typeId = String,
86
- // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@53d6fe60,
86
+ // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@5ca5d848,
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@53d6fe60,
100
+ // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@5ca5d848,
101
101
  // doc = Doc(blocks = IndexedSeq(), metadata = Map()),
102
102
  // modifiers = List(),
103
103
  // storedDefaultValue = None,
@@ -109,13 +109,13 @@ dynamic
109
109
  // Term(
110
110
  // name = "address",
111
111
  // value = Record(
112
- // fields = Vector(
112
+ // fields = IndexedSeq(
113
113
  // Term(
114
114
  // name = "street",
115
115
  // value = Primitive(
116
116
  // primitiveType = String(None),
117
117
  // typeId = String,
118
- // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@53d6fe60,
118
+ // primitiveBinding = zio.blocks.schema.binding.NoBinding$$anon$1@5ca5d848,
119
119
  // doc = Doc(blocks = IndexedSeq(), metadata = Map()),
120
120
  // modifiers = List(),
121
121
  // storedDefaultValue = None,
@@ -232,7 +232,7 @@ dynSchema.check(valid)
232
232
  dynSchema.check(missing)
233
233
  // res8: Option[SchemaError] = Some(
234
234
  // SchemaError(
235
- // List(MissingField(source = DynamicOptic(ArraySeq()), fieldName = "y"))
235
+ // List(MissingField(source = DynamicOptic(IndexedSeq()), fieldName = "y"))
236
236
  // )
237
237
  // )
238
238
  dynSchema.check(wrongType)
@@ -240,7 +240,7 @@ dynSchema.check(wrongType)
240
240
  // SchemaError(
241
241
  // List(
242
242
  // ExpectationMismatch(
243
- // source = DynamicOptic(ArraySeq(Field("y"))),
243
+ // source = DynamicOptic(IndexedSeq(Field("y"))),
244
244
  // expectation = "Expected Int, got String"
245
245
  // )
246
246
  // )
@@ -44,13 +44,17 @@ object JsonFormat extends BinaryFormat("application/json", JsonCodecDeriver)
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` | `JsonCodec[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
 
@@ -162,7 +166,7 @@ val decoded: Either[SchemaError, Person] = codec.decode(bytes)
162
166
 
163
167
  ### Avro Schema Generation
164
168
 
165
- Each `AvroBinaryCodec` exposes an `avroSchema` property containing the Apache Avro schema:
169
+ Each `AvroCodec` exposes an `avroSchema` property containing the Apache Avro schema:
166
170
 
167
171
  ```scala
168
172
  import zio.blocks.schema._
@@ -308,7 +312,7 @@ orders[2]{id,total}:
308
312
 
309
313
  ### Configuration Options
310
314
 
311
- The `ToonBinaryCodecDeriver` provides extensive configuration:
315
+ The `ToonCodecDeriver` provides extensive configuration:
312
316
 
313
317
  ```scala
314
318
  import zio.blocks.schema._
@@ -320,7 +324,7 @@ object Person {
320
324
  }
321
325
 
322
326
  // Custom deriver with snake_case field names
323
- val customDeriver = ToonBinaryCodecDeriver
327
+ val customDeriver = ToonCodecDeriver
324
328
  .withFieldNameMapper(NameMapper.SnakeCase)
325
329
  .withArrayFormat(ArrayFormat.Tabular)
326
330
  .withDiscriminatorKind(DiscriminatorKind.Field("type"))
@@ -362,7 +366,7 @@ val keyCodec = Schema[Shape].derive(ToonFormat)
362
366
  // radius: 5
363
367
 
364
368
  // Field discriminator
365
- val fieldDeriver = ToonBinaryCodecDeriver
369
+ val fieldDeriver = ToonCodecDeriver
366
370
  .withDiscriminatorKind(DiscriminatorKind.Field("type"))
367
371
  val fieldCodec = Schema[Shape].derive(fieldDeriver)
368
372
  // type: Circle
@@ -386,7 +386,7 @@ modeJson.patch(modePatch, PatchMode.Strict)
386
386
  // SchemaError(
387
387
  // List(
388
388
  // ExpectationMismatch(
389
- // source = DynamicOptic(ArraySeq()),
389
+ // source = DynamicOptic(IndexedSeq()),
390
390
  // expectation = "Key 'a' already exists in object"
391
391
  // )
392
392
  // )
@@ -723,7 +723,7 @@ fieldPatch.apply(doc)
723
723
  // res40: Either[SchemaError, Json] = Left(
724
724
  // SchemaError(
725
725
  // List(
726
- // MissingField(source = DynamicOptic(ArraySeq()), fieldName = "updatedAt")
726
+ // MissingField(source = DynamicOptic(IndexedSeq()), fieldName = "updatedAt")
727
727
  // )
728
728
  // )
729
729
  // )
@@ -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.31"
78
+ libraryDependencies += "dev.zio" %% "zio-blocks-mediatype" % "0.0.33"
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.31"
84
+ libraryDependencies += "dev.zio" %%% "zio-blocks-mediatype" % "0.0.33"
85
85
  ```
86
86
 
87
87
  Supported Scala versions: 2.13.x and 3.x.
@@ -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.31"
39
+ libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.33"
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.31"
45
+ libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.33"
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.31"
58
+ libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.33"
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.31"
95
+ libraryDependencies += "dev.zio" %% "zio-blocks-scope" % "0.0.33"
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.31"
101
+ libraryDependencies += "dev.zio" %%% "zio-blocks-scope" % "0.0.33"
102
102
  ```
103
103
 
104
104
  Supported Scala versions: 2.13.x and 3.x.
@@ -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.31"
42
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
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.31"
48
+ libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.33"
49
49
  ```
50
50
 
51
51
  Supported Scala versions: 2.13.x and 3.x.
@@ -89,7 +89,7 @@ manualAs.from(Long.MaxValue)
89
89
  // SchemaError(
90
90
  // List(
91
91
  // ConversionFailed(
92
- // source = DynamicOptic(ArraySeq()),
92
+ // source = DynamicOptic(IndexedSeq()),
93
93
  // details = "overflow",
94
94
  // cause = None
95
95
  // )
@@ -213,7 +213,7 @@ boxAs.from(LongBox(Long.MaxValue))
213
213
  // SchemaError(
214
214
  // List(
215
215
  // ConversionFailed(
216
- // source = DynamicOptic(ArraySeq()),
216
+ // source = DynamicOptic(IndexedSeq()),
217
217
  // details = "Value 9223372036854775807 is out of range for Int [-2147483648, 2147483647]",
218
218
  // cause = None
219
219
  // )
@@ -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@70332401
243
+ // revAs: As[LongBox, IntBox] = zio.blocks.schema.As$$anon$1@6145661b
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$17467/0x00007f7456961130@3a9535e3
305
+ // intToStr: Into[Int, String] = zio.blocks.schema.AsLowPriorityImplicits$$Lambda$17549/0x00007faac29bf110@e1a6316
306
306
  intToStr.into(42)
307
307
  // res14: Either[SchemaError, String] = Right("42")
308
308
  ```
@@ -387,7 +387,7 @@ numericAs.from(LongModel(Long.MaxValue))
387
387
  // SchemaError(
388
388
  // List(
389
389
  // ConversionFailed(
390
- // source = DynamicOptic(ArraySeq()),
390
+ // source = DynamicOptic(IndexedSeq()),
391
391
  // details = "Value 9223372036854775807 is out of range for Int [-2147483648, 2147483647]",
392
392
  // cause = None
393
393
  // )
@@ -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.31"
72
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
73
73
  ```
74
74
 
75
75
  For Scala.js:
76
76
 
77
77
  ```scala
78
- libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.31"
78
+ libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.33"
79
79
  ```
80
80
 
81
81
  Supported Scala versions: 2.13.x and 3.x.
@@ -241,7 +241,7 @@ Into[Long, Int].into(Long.MaxValue)
241
241
  // SchemaError(
242
242
  // List(
243
243
  // ConversionFailed(
244
- // source = DynamicOptic(ArraySeq()),
244
+ // source = DynamicOptic(IndexedSeq()),
245
245
  // details = "Value 9223372036854775807 is out of range for Int [-2147483648, 2147483647]",
246
246
  // cause = None
247
247
  // )
@@ -253,7 +253,7 @@ Into[Double, Int].into(3.14)
253
253
  // SchemaError(
254
254
  // List(
255
255
  // ConversionFailed(
256
- // source = DynamicOptic(ArraySeq()),
256
+ // source = DynamicOptic(IndexedSeq()),
257
257
  // details = "Value 3.14 cannot be precisely converted to Int",
258
258
  // cause = None
259
259
  // )
@@ -399,7 +399,7 @@ conv.into(Raw(Long.MaxValue))
399
399
  // SchemaError(
400
400
  // List(
401
401
  // ConversionFailed(
402
- // source = DynamicOptic(ArraySeq()),
402
+ // source = DynamicOptic(IndexedSeq()),
403
403
  // details = "Value 9223372036854775807 is out of range for Int [-2147483648, 2147483647]",
404
404
  // cause = None
405
405
  // )
@@ -623,7 +623,7 @@ validate.into(PersonRaw("Bob", 200))
623
623
  // SchemaError(
624
624
  // List(
625
625
  // ConversionFailed(
626
- // source = DynamicOptic(ArraySeq()),
626
+ // source = DynamicOptic(IndexedSeq()),
627
627
  // details = "Validation failed for field 'age': NonEmptyChunk(200 did not satisfy between(0, 150))",
628
628
  // cause = None
629
629
  // )
@@ -854,7 +854,7 @@ result
854
854
  // SchemaError(
855
855
  // List(
856
856
  // ExpectationMismatch(
857
- // source = DynamicOptic(ArraySeq()),
857
+ // source = DynamicOptic(IndexedSeq()),
858
858
  // expectation = "Expected a record"
859
859
  // )
860
860
  // )
@@ -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.31"
73
+ libraryDependencies += "dev.zio" %% "zio-blocks-schema" % "0.0.33"
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.31"
79
+ libraryDependencies += "dev.zio" %%% "zio-blocks-schema" % "0.0.33"
80
80
  ```
81
81
 
82
82
  Supported Scala versions: 2.13.x and 3.x.
@@ -588,7 +588,7 @@ ZIO Blocks provides the `transform` method for creating schemas for wrapper type
588
588
 
589
589
  ```scala
590
590
  final case class Schema[A](reflect: Reflect.Bound[A]) {
591
- def transform[B](to: A => B, from: B => A): Schema[B] = ???
591
+ def transform[B](to: A => B, from: B => A)(implicit typeId: TypeId[B]): Schema[B] = ???
592
592
  }
593
593
  ```
594
594