zio.blocks.schema.As
See theAs companion object
Bidirectional conversion between types A and B.
As[A, B] extends Into[A, B], so it can be used anywhere an Into is expected. Use reverse to get an As[B, A] that reverses the direction.
For As[A, B] to be derivable, the bidirectional conversion must be compatible:
Compatibility Rules:
- Field mappings must be consistent: The same field correspondence in both directions
- Coercions must be invertible with runtime validation (Int ↔ Long, Float ↔ Double, etc.)
- Optional fields: Can add optional fields in one direction (becomes None in reverse)
- Default values: Allowed only on fields that exist in both types. Fields with defaults that don't exist in the other type break round-trip guarantee.
- Collection types: Can convert between different collection types (may be lossy for Set/List conversions)
Attributes
Members list
In this article