dev.constructive.eo.laws.typeclass
Laws for eo's composition typeclasses — AssociativeFunctor, Composer, ForgetfulFunctor, ForgetfulTraverse.
Attributes
Members list
Packages
Discipline RuleSet bundles for the typeclass laws in dev.constructive.eo.laws.typeclass.
Type members
Classlikes
Laws for dev.constructive.eo.compose.AssociativeFunctor. Operational, not category-theoretic: the "associative" part refers to packing Xo / Xi into Z, not monoidal structure.
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
- Supertypes
-
class Objecttrait Matchableclass Any
C1 — path independence. An Iso → Affine via Tuple2 vs via Either should be modify-equivalent.
C1 — path independence. An Iso → Affine via Tuple2 vs via Either should be modify-equivalent.
Attributes
- Source
- ComposerLaws.scala
- Supertypes
-
class Objecttrait Matchableclass Any
C2 — chain preserves get whenever both ends have an Accessor.
C2 — chain preserves get whenever both ends have an Accessor.
Attributes
- Source
- ComposerLaws.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Law equations for any ForgetfulFunctor[F] instance — the usual two functor laws, stated in carrier-carrier form:
Law equations for any ForgetfulFunctor[F] instance — the usual two functor laws, stated in carrier-carrier form:
map(id) == idmap(g) ∘ map(f) == map(f andThen g)
Holds for every carrier EO uses: Tuple2, Either, Affine, ModifyF, Direct, Forget[F], MultiFocus[F]. The law trait is parameterised so downstream adding a new carrier can witness its ForgetfulFunctor instance here.
Equality is structural — if the carrier wraps a function (as ModifyF does), discipline-checking this law requires an extensional comparison. See dev.constructive.eo.laws.data.ModifyFLaws for that carrier-specific phrasing.
Attributes
- Source
- ForgetfulFunctorLaws.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Law equations for any ForgetfulTraverse[F, Applicative] — the identity law stated at Id:
Law equations for any ForgetfulTraverse[F, Applicative] — the identity law stated at Id:
traverse[Id](fa)(a => a) == fa— the classicaltraverse(pure) == pure ∘ _identity, collapsed throughId[X] = X.
The full ForgetfulTraverse family in core has two flavours: [_ <: Applicative] (Affine, Forget[F], PowerSeries, Direct at Invariant) and [_ <: Distributive] (ModifyF). We expose the [Applicative] flavour here because Id-identity is the widely applicable anchor law; the Distributive variant collapses to a tautology at Id, so witnessing it adds no signal.
The naturality and sequential-composition laws (the other two classical Traverse laws) are not stated here — they require an applicative-transformation fixture, which in turn needs a second concrete Applicative beyond Id.
Attributes
- Source
- ForgetfulTraverseLaws.scala
- Supertypes
-
class Objecttrait Matchableclass Any