Affine

dev.constructive.eo.data.Affine
See theAffine companion trait
object Affine

Constructors and typeclass instances for Affine.

Attributes

Companion
trait
Source
Affine.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Affine.type

Members list

Grouped members

Instances

given assoc: [Xo, Xi] => assoc[Xo, Xi]

Composition functor for Affine carriers. Xo / Xi are deliberately unbounded — Affine's Fst[X] / Snd[X] match types stay inert when X is not a Tuple, which is sound for every shipped concrete optic (every concrete X is a Tuple2). A ValidCarrier[F, X] threading is a possible future cleanup.

Composition functor for Affine carriers. Xo / Xi are deliberately unbounded — Affine's Fst[X] / Snd[X] match types stay inert when X is not a Tuple, which is sound for every shipped concrete optic (every concrete X is a Tuple2). A ValidCarrier[F, X] threading is a possible future cleanup.

Attributes

Source
Affine.scala

Prism → Affine — reuses the Either decomposition for Affine's miss / hit branches.

Prism → Affine — reuses the Either decomposition for Affine's miss / hit branches.

Attributes

Source
Affine.scala
object either2affine extends Composer[Either, Affine]

Prism → Affine — reuses the Either decomposition for Affine's miss / hit branches.

Prism → Affine — reuses the Either decomposition for Affine's miss / hit branches.

Attributes

Source
Affine.scala
Supertypes
trait Composer[Either, Affine]
class Object
trait Matchable
class Any
Self type
given fold: fold

ForgetfulFold[Affine] — miss empty, hit runs f on the focus. Carrier-owned (like map / traverse), so it resolves through Affine's companion with no import.

ForgetfulFold[Affine] — miss empty, hit runs f on the focus. Carrier-owned (like map / traverse), so it resolves through Affine's companion with no import.

Attributes

Source
Affine.scala
object fold extends ForgetfulFold[Affine]

ForgetfulFold[Affine] — miss empty, hit runs f on the focus. Carrier-owned (like map / traverse), so it resolves through Affine's companion with no import.

ForgetfulFold[Affine] — miss empty, hit runs f on the focus. Carrier-owned (like map / traverse), so it resolves through Affine's companion with no import.

Attributes

Source
Affine.scala
Supertypes
class Object
trait Matchable
class Any
Self type
fold.type
given map: map

ForgetfulFunctor[Affine] — maps the focus B, passing the miss branch through. One allocation per hit-branch map; pure pass-through on miss.

ForgetfulFunctor[Affine] — maps the focus B, passing the miss branch through. One allocation per hit-branch map; pure pass-through on miss.

Attributes

Source
Affine.scala
object map extends ForgetfulFunctor[Affine]

ForgetfulFunctor[Affine] — maps the focus B, passing the miss branch through. One allocation per hit-branch map; pure pass-through on miss.

ForgetfulFunctor[Affine] — maps the focus B, passing the miss branch through. One allocation per hit-branch map; pure pass-through on miss.

Attributes

Source
Affine.scala
Supertypes
class Object
trait Matchable
class Any
Self type
map.type

ForgetfulTraverse[Affine, Applicative] — lifts a focus-level A => G[B] into an Affine[X, A] => G[Affine[X, B]]. Unlocks .modifyA / .all / .modifyF on Affine- carrier optics.

ForgetfulTraverse[Affine, Applicative] — lifts a focus-level A => G[B] into an Affine[X, A] => G[Affine[X, B]]. Unlocks .modifyA / .all / .modifyF on Affine- carrier optics.

Attributes

Source
Affine.scala

ForgetfulTraverse[Affine, Applicative] — lifts a focus-level A => G[B] into an Affine[X, A] => G[Affine[X, B]]. Unlocks .modifyA / .all / .modifyF on Affine- carrier optics.

ForgetfulTraverse[Affine, Applicative] — lifts a focus-level A => G[B] into an Affine[X, A] => G[Affine[X, B]]. Unlocks .modifyA / .all / .modifyF on Affine- carrier optics.

Attributes

Source
Affine.scala
Supertypes
class Object
trait Matchable
class Any
Self type
traverse.type

Lens → Affine. Always-Hit at read; lets lens.andThen(optional) type-check via the cross-carrier Morph[Tuple2, Affine] that picks up this composer.

Lens → Affine. Always-Hit at read; lets lens.andThen(optional) type-check via the cross-carrier Morph[Tuple2, Affine] that picks up this composer.

Attributes

Source
Affine.scala
object tuple2affine extends Composer[Tuple2, Affine]

Lens → Affine. Always-Hit at read; lets lens.andThen(optional) type-check via the cross-carrier Morph[Tuple2, Affine] that picks up this composer.

Lens → Affine. Always-Hit at read; lets lens.andThen(optional) type-check via the cross-carrier Morph[Tuple2, Affine] that picks up this composer.

Attributes

Source
Affine.scala
Supertypes
trait Composer[Tuple2, Affine]
class Object
trait Matchable
class Any
Self type

Constructors

def affine: Affine[X, B]

Convenience wrapping extension — turns a raw Either[Fst[X], (Snd[X], B)] into an Affine[X, B] via the apply smart constructor.

Convenience wrapping extension — turns a raw Either[Fst[X], (Snd[X], B)] into an Affine[X, B] via the apply smart constructor.

Attributes

Source
Affine.scala
def apply[A, B](e: Either[Fst[A], (Snd[A], B)]): Affine[A, B]

Legacy smart constructor — dispatches a raw Either to the matching variant. Prefer new Miss(...) / new Hit(...) in new code.

Legacy smart constructor — dispatches a raw Either to the matching variant. Prefer new Miss(...) / new Hit(...) in new code.

Attributes

Source
Affine.scala
def ofLeft[X, B](l: Fst[X]): Affine[X, B]

Miss-branch constructor — produce an Affine[X, B] carrying l as its Fst component.

Miss-branch constructor — produce an Affine[X, B] carrying l as its Fst component.

Attributes

Source
Affine.scala
def ofRight[X, B](r: (Snd[X], B)): Affine[X, B]

Hit-branch constructor — produce an Affine[X, B] carrying r._1 as Snd and r._2 as the focus.

Hit-branch constructor — produce an Affine[X, B] carrying r._1 as Snd and r._2 as the focus.

Attributes

Source
Affine.scala

Type members

Classlikes

final class Hit[A, B](val snd: Snd[A], val b: B) extends Affine[A, B]

Hit-branch variant: focus present. Stores snd and b as direct fields.

Hit-branch variant: focus present. Stores snd and b as direct fields.

Attributes

Source
Affine.scala
Supertypes
trait Affine[A, B]
class Object
trait Matchable
class Any
final class Miss[A, B](val fst: Fst[A]) extends Affine[A, B]

Miss-branch variant — no focus, stores fst: Fst[A] directly. B is phantom at runtime; callers re-typing across a phantom-B change should prefer widenB over asInstanceOf.

Miss-branch variant — no focus, stores fst: Fst[A] directly. B is phantom at runtime; callers re-typing across a phantom-B change should prefer widenB over asInstanceOf.

Attributes

Source
Affine.scala
Supertypes
trait Affine[A, B]
class Object
trait Matchable
class Any