|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
The path functor for the Path <·> shape (#508 / PR #521 review).
More...
Public Types | |
| template<typename U> | |
| using | Shape = dedekind::sequences::Path<U> |
F_obj: the type-constructor action of the functor. The only Functor-shaped surface path_functor reifies. | |
The path functor for the Path <·> shape (#508 / PR #521 review).
Carries the Shape = Path alias used by the Kleisli witness registry (unit_witness / counit_witness / IsKleisliTriple / IsCoKleisliTriple). Named path_functor for naming-convention parity with the sibling maybe_functor / vec2_functor / matrix2x2_functor functors in other partitions.
Path's (co)monadic structure is certified at the Kleisli-witness layer (:kleisli — unit_witness, counit_witness, IsKleisliTriple, IsCoKleisliTriple), not via the strict dedekind::category::IsComonad / IsMonad. This is a deliberate, textbook-sanctioned choice, not a Path-specific defect:
Shape, counit ε, coextension <<=) determine each other (the dual of Manes' Kleisli-triple theorem). The :kleisli layer is the extension presentation; :monad's IsComonad is the comultiplication presentation. Path lives in the former.IsComonad cannot bite any non-identity type-constructor here, Path included. IsComonad refines IsEndofunctor, which demands Σ_cat == Τ_cat. Every reified functor in the library maps Set<T> → Set<F<T>> (maybe_functor, tuple_functor), so Σ_cat ≠ Τ_cat and none of them are endofunctors — the only IsEndofunctor / IsComonad witness in the codebase is identity_functor. (Confirmed mechanically: maybe_functor and tuple_functor are IsShapedFunctor but not IsEndofunctor.) So reifying φ on path_functor would buy IsShapedFunctor at best — never IsComonad — because Path<T> changes the object type Set<T> → Set<Path<T>> exactly as maybe_functor does.path_functor therefore reifies only the object-action (Shape) the Kleisli registry consumes; φ (= map) is recoverable but left unreified because the :kleisli layer is the level on which the equivalence is actually witnessed for non-identity carriers.
Path carries both monadic and comonadic structure (per the partition's header note), but is not a Frobenius monad: on streams \(\delta \circ \mu\) reads \(s_{i+j}(i+j)\) where \(T\mu \circ \delta T\) reads \(s_{i+j}(j)\). At the Kleisli-witness level:
path_functor is the tag for the type-constructor Path <·> on objects (object-action only; see above).unit_witness<path_functor<T>, T> is the T-component of η: Id ⇒ T (constant path λn.x).counit_witness<path_functor<T>, T> is the T-component of ε: T ⇒ Id (head sampling p.at(0)).IsKleisliTriple / IsCoKleisliTriple static_asserts witness both triples mechanically, and !IsFrobenius that the Frobenius law is not claimed.