dev.constructive.eo.laws.eo

Laws specific to eo's composition machinery rather than any single optic: compose associativity/identity (ComposeLaws), fold/traverse consistency, modifyA coherence, reverse/transform round-trips, and Morph faithfulness.

Attributes

Members list

Packages

Discipline RuleSet bundles for the composition-machinery laws in dev.constructive.eo.laws.eo.

Discipline RuleSet bundles for the composition-machinery laws in dev.constructive.eo.laws.eo.

Attributes

Type members

Classlikes

trait FoldMapHomomorphismLaws[S, A, F[_, _]]

E1 — optic.foldMap is a Monoid homomorphism on the target monoid (tested at Int with additive Monoid[Int], which is enough to witness the law).

E1 — optic.foldMap is a Monoid homomorphism on the target monoid (tested at Int with additive Monoid[Int], which is enough to witness the law).

Attributes

Source
FoldAndTraverseLaws.scala
Supertypes
class Object
trait Matchable
class Any
trait IsoComposeLaws[S, A, B]

C3/C4 — Iso ∘ Iso composition laws.

C3/C4 — Iso ∘ Iso composition laws.

Attributes

Source
ComposeLaws.scala
Supertypes
class Object
trait Matchable
class Any
trait LensComposeLaws[S, A, B]

C1/C2 — Lens ∘ Lens composition laws.

C1/C2 — Lens ∘ Lens composition laws.

Attributes

Source
ComposeLaws.scala
Supertypes
class Object
trait Matchable
class Any
trait ModifyAConstLaws[S, A, F[_, _]]

D3 — optic.modifyA[Const[M, *]] is pointwise equal to optic.foldMap on the same function, with M = Int (additive).

D3 — optic.modifyA[Const[M, *]] is pointwise equal to optic.foldMap on the same function, with M = Int (additive).

Attributes

Source
ModifyALaws.scala
Supertypes
class Object
trait Matchable
class Any
trait ModifyAIdLaws[S, A, F[_, _]]

D1 — optic.modifyA[Id] is pointwise equal to optic.modify.

D1 — optic.modifyA[Id] is pointwise equal to optic.modify.

Attributes

Source
ModifyALaws.scala
Supertypes
class Object
trait Matchable
class Any
trait MorphLaws[S, A, F[_, _], G[_, _]]

Laws that pin down Optic.morph — EO's carrier-coercion extension.

Laws that pin down Optic.morph — EO's carrier-coercion extension.

A1/I1. Morph preserves modify: reshaping the carrier does not change what the optic does to the focus.

A2. Morph preserves get: for any carriers F / G that both expose Accessor, reshaping preserves the read path as well.

These two laws are the foundation of EO's "write once, reuse everywhere" claim about optics. If they failed, a user could not safely convert a Lens to an Optional or a Getter to a Fold without changing observable behaviour.

Attributes

Source
MorphLaws.scala
Supertypes
class Object
trait Matchable
class Any
trait OptionalComposeLaws[S, A, B]

Optional ∘ Optional composition laws.

Optional ∘ Optional composition laws.

Attributes

Source
ComposeLaws.scala
Supertypes
class Object
trait Matchable
class Any
trait PrismComposeLaws[S, A, B]

C5 — Prism ∘ Prism composition laws.

C5 — Prism ∘ Prism composition laws.

Attributes

Source
ComposeLaws.scala
Supertypes
class Object
trait Matchable
class Any
trait PutIsReverseGetLaws[S, A]

H3 — Iso put is the curried reverseGet ∘ pure.

H3 — Iso put is the curried reverseGet ∘ pure.

Attributes

Source
ReverseAndTransformLaws.scala
Supertypes
class Object
trait Matchable
class Any
trait ReverseInvolutionLaws[S, A]

B1 — Iso reverse is involutive on both get and reverseGet.

B1 — Iso reverse is involutive on both get and reverseGet.

Attributes

Source
ReverseAndTransformLaws.scala
Supertypes
class Object
trait Matchable
class Any
trait TransformLaws[S, A, X0]

H1/H2/H4 — Lens transform / place / transfer mutually agree.

H1/H2/H4 — Lens transform / place / transfer mutually agree.

Attributes

Source
ReverseAndTransformLaws.scala
Supertypes
class Object
trait Matchable
class Any