AffineLaws
Carrier-level laws for Affine[X, A].
Affine is the carrier behind Optional: a sum of a "no write path" case (Fst[X]) and a tuple-like "got the focus" case ((Snd[X], A)). The laws pin down its two main type-class instances:
ForgetfulFunctor[Affine]— identity and composition.ForgetfulTraverse[Affine, Applicative]atId— identity.
The AssociativeFunctor[Affine, X, Y] instance is already exercised by Optional ∘ Optional at the optic level (see dev.constructive.eo.laws.eo.OptionalComposeLaws); re-stating its associativity equations as a standalone law class would duplicate that coverage without adding signal.
On the BUILD seam (see Affine.graft), the two arms are the decoration vocabulary — Miss = the slot is finished (an apo graft, a futu unroll), Hit = keep going. The build-channel laws pin the finished arm as final: invisible to the focus (getOption empty, foldMap empty) and inert under map — the carrier-shaped halves of "done is final"; the per-value graft(done(t)) == t equation is stated against concrete decoration citizens (which pin Fst[X]), not here.
Attributes
- Source
- AffineLaws.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any