|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
The reified composition arrow g∘f: "apply @c F, then @c G" (diagrammatic f≫g order), the arrow-algebra companion to Identity.
More...

Public Types | |
| using | Domain = Dom<F> |
| using | Codomain = Cod<G> |
Public Member Functions | |
| constexpr bool | operator== (const Compose &) const =default |
Equal when the legs are (:cartesian's Arrows). | |
|
template<typename X> requires Presents<X, Domain> && requires(const F& f_, const G& g_, const X& x_) { g_(f_(x_)); } | |
| constexpr auto | operator() (const X &x) const |
Run the pipeline (g∘f)(x) = g(f(x)), at any presentation of the domain (morphism__Objects_And_Their_Presentations): two arrows between objects presented by many types compose like any other. Where the result converts to the codomain's value type it is returned as that type, as before. | |
Public Attributes | |
| F | f |
| G | g |
The reified composition arrow g∘f: "apply @c F, then @c G" (diagrammatic f≫g order), the arrow-algebra companion to Identity.
Where Identity is the unit, Compose is the binary that makes composition a first-class type. It is what operator>> returns (f≫g = Compose<F,G>{f,g}); the previous lambda-wrapped arrow<A,C> erased the operand types, whereas Compose keeps F,G in the result type, so it is an IsArrow that downstream reasoning can pattern-match on. Two payoffs it unlocks (#908):
f*: the contravariant pullback preimage(f,P) is P∘f, i.e. Compose<F,P> — the general shape whose closed-form collapses (halfspace, :relational, ...) are the downstream fibres.:posetal registers the Horn clauses co∘co=co and anti∘anti=co (two flips cancel) on Compose, closing the one rule the variance logic program was missing.