ModifyF

dev.constructive.eo.data.ModifyF
See theModifyF companion object
final class ModifyF[A, B](val modifier: (Fst[A], Snd[A] => B)) extends AnyVal

Carrier for the Modify family — pairs a source Fst[A] with a continuation Snd[A] => B.

Same-carrier composition (modify.andThen(modify)) ships via ModifyF.assocModifyFAssociativeFunctor[ModifyF, Xo, Xi] with type Z = (Fst[Xo], Snd[Xi]). The deferred-modify semantic fits the protocol once you observe that composeTo only needs to seed (xo, identity) (no inner-to call required, since ModifyF's continuation is structurally identity at every canonical construction site — coerceToModify and Modify.apply); composeFrom then extracts the user's c2d from the mapped continuation and routes it through inner.from then outer.from. The asInstanceOf casts inside the instance are sound under the universal convention that every ModifyF optic stores X = (S_outer, A_focus) (enforced at every construction site).

Type parameters

A

existential leftover tuple

B

focus written back

Attributes

Companion
object
Source
ModifyF.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete fields

val modifier: (Fst[A], Snd[A] => B)

Attributes

Source
ModifyF.scala