dev.constructive.eo.compose.Morph
See theMorph companion object
Picks the direction to morph a pair of optics into a shared carrier so .andThen works across carriers. Four givens, decreasing priority:
- Morph.same — same carrier, no morph (
Out = F). - Morph.leftToRight — morph left into
GviaComposer[F, G](Out = G). - Morph.rightToLeft — morph right into
FviaComposer[G, F](Out = F). - LowPriorityMorphInstances.bothViaAffine — both into
Affinewhen neither bridges directly (covers e.g. Prism ∘ Lens).
cats-eo ships essentially one bidirectional Composer pair — forget2multifocus / multifocus2forget (the latter restricted to T = Unit). For every other carrier pair at most one of the first three fires; for that one pair a Forget[F] ⇄ MultiFocus[F] chain can be ambiguous, resolved by routing through the explicit Composer[..].to(o) form (see multifocus2forget's docstring).
Type parameters
- F
-
outer carrier
- G
-
inner carrier
Attributes
- Companion
- object
- Source
- Morph.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article