SeamLaws
Laws that exercise an Optional's WRITE SEAM — the generic Optic.modify / Optic.replace (from(map(to(s), _))), the path an UPCAST or COMPOSED write actually takes, NOT any concrete-class convenience surface that might sidestep from.
'''Run these on a DRILLED / partial-cover optic''' — a focus with surrounding context (a field of a larger record, an element beside siblings). A carrier whose from reconstructs the focus STANDALONE (dropping the context) fails seamModifyIdentity here, even though a full-cover fixture passes it trivially. That is precisely the class of bug the full-cover-only Prism / Optional discipline suites could never catch — the 2026-07 avro/circe record-face sibling-drop: Either-carried drilled prisms whose from(Right(b)) = reverseGet(b) threw the siblings away on every composed / upcast write. This law makes that failure loud for any carrier.
Equality is INJECTED because some carriers' S has no lawful universal ==: avro IndexedRecord uses schema-instance-sensitive equals, so pass a structural comparison; circe Json and most value types can pass _ == _.
Attributes
- Source
- SeamLaws.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any