Read-side composition across the read/write seam — the join that AssociativeFunctor (which needs B-threading on a shared carrier) structurally cannot express. Composes the READ halves of two optics, ignoring both write sides, and lands at the read-only join of their strengths:
total ∘ total = Getter (Accessor ∘ Accessor)
total ∘ partial = AffineFold (any mix involving a PartialAccessor)
partial ∘ total = AffineFold
partial ∘ partial = AffineFold
Fold[F] ∘ total = Fold[F] (F has a cats Functor: the fold stays in its container)
Fold[F] ∘ partial = Fold[F] (F has a cats FunctorFilter: an inner miss is F's empty)
many on either side = Fold (ForgetfulFold fallback, List-backed)
The two Fold[F] cells keep the outer fold's container through single-focus inners — a fold into Option, Either[E, *] or an error-carrying result type stays one, with the inner read applied inside it, instead of being flattened to a List of foci.
Drives the read-collapse andThen members: the Optic trait's any-outer ∘ read-only-inner overload and the read-only-outer ∘ any-inner members on optics.Getter / optics.PickFold / optics.ForgetFold. Instances live in this companion, so they are in implicit scope for every carrier pair with no import.
Type parameters
- F
-
outer optic's carrier
- G
-
inner optic's carrier
Attributes
- Companion
- object
- Source
- ReadCompose.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any