AssociativeFunctorLaws

dev.constructive.eo.laws.typeclass.AssociativeFunctorLaws
trait AssociativeFunctorLaws[S, A, C, F[_, _]]

Laws for dev.constructive.eo.compose.AssociativeFunctor. Operational, not category-theoretic: the "associative" part refers to packing Xo / Xi into Z, not monoidal structure.

  • A1 compose-modify distributes: composed.modify(f)(s) == outer.modify(inner.modify(f))(s).
  • A2 compose-modify identity: a Cogen-free specialisation of A1.

Both require ForgetfulFunctor[F] (every cats-eo AssociativeFunctor carrier also ships one).

Type parameters

A

outer focus / inner source (mono A = B)

C

inner focus (mono C = D)

F

shared carrier

S

outer source (mono S = T)

Attributes

Source
AssociativeFunctorLaws.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def composed: Optic[S, S, C, C, F]

outer.andThen(inner) materialised by the spec — the law trait itself can't call .andThen because F's Xo / Xi are abstract here.

outer.andThen(inner) materialised by the spec — the law trait itself can't call .andThen because F's Xo / Xi are abstract here.

Attributes

Source
AssociativeFunctorLaws.scala
def inner: Optic[A, A, C, C, F]

Inner optic.

Inner optic.

Attributes

Source
AssociativeFunctorLaws.scala
def outer: Optic[S, S, A, A, F]

Outer optic.

Outer optic.

Attributes

Source
AssociativeFunctorLaws.scala

Concrete methods

def composeModifyDistributes(s: S, f: C => C): Boolean

A1 — composed.modify(f)(s) == outer.modify(inner.modify(f))(s).

A1 — composed.modify(f)(s) == outer.modify(inner.modify(f))(s).

Attributes

Source
AssociativeFunctorLaws.scala
def composeModifyIdentity(s: S): Boolean

A2 — composed.modify(identity)(s) == s.

A2 — composed.modify(identity)(s) == s.

Attributes

Source
AssociativeFunctorLaws.scala

Givens

Givens

given functor: => ForgetfulFunctor[F]

ForgetfulFunctor evidence driving modify on the shared carrier.

ForgetfulFunctor evidence driving modify on the shared carrier.

Attributes

Source
AssociativeFunctorLaws.scala