CanModifyP

dev.constructive.eo.CanModifyP
See theCanModifyP companion object
trait CanModifyP[S, T, A, B]

Capability: the focused A inside an S can be rewritten to a B, producing a T — the carrier-free surface of any optic whose carrier admits forgetful.ForgetfulFunctor (every writable family: Lens, Iso, Prism, Optional, Traversal, Modify).

Prefer this trait in consuming signatures; the monomorphic CanModify alias covers the common S = T, A = B case. A read-then-write method should demand ONE CanModify (whose modify observes and rewrites in a single pass) rather than split CanGet + CanModify evidence — nothing ties two separately-summoned capabilities to the same optic. See CanGet for the doctrine and the coherence rule.

Attributes

Companion
object
Source
CanModify.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BijectionIso[S, T, A, B]
class GetReplaceLens[S, T, A, B]
class MendTearPrism[S, T, A, B]
class Modify[S, T, A, B]
class Optional[S, T, A, B]
class PickMendPrism[S, A, B]
class SplitCombineLens[S, T, A, B, XA]
class SimpleLens[S, A, XA]
Show all

Members list

Value members

Abstract methods

def modify(f: A => B): S => T

Attributes

Source
CanModify.scala

Concrete methods

def replace(b: B): S => T

Attributes

Source
CanModify.scala