|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
The HAS-A posture in code: an Algebra HAS-A Carrier (under operations Ops) iff the carrier closes the operations (IsAlgebra), the carrier is mereologically a part of the algebra, and the algebra exposes the part via the arrow_drill_down projector.
More...
The HAS-A posture in code: an Algebra HAS-A Carrier (under operations Ops) iff the carrier closes the operations (IsAlgebra), the carrier is mereologically a part of the algebra, and the algebra exposes the part via the arrow_drill_down projector.
In OO terms, HAS-A composition is mereological parthood: the named-carrier type Algebra (e.g. a Rational, a Complex<F>, a Vec2V<T>, or a thin view over a primitive carrier like F_2) HAS-A Carrier in the sense that the carrier is a part of the algebra and the algebra owns access to it. In universal-algebra vocabulary (Burris–Sankappanavar 1981 §I.1): every algebra (A, F) is a pair of a carrier set A and a family F of operations. This concept names both halves of that pair at the type level: the algebra-side closure (IsAlgebra<Carrier, Ops...>) and the mereological role of the carrier inside the algebra.
The concept composes three existing primitives:
IsAlgebra<Carrier, Ops...> from this partition — the closure tier of the (A, F) pair (each Op closes on the carrier A, and the carrier is std::semiregular).IsPartOfRelation<Carrier, Algebra, bool> from category:mereology — the value-level part-whole relation, accepted in any of three encodings (order-style <=, predicate-style whole(part), or indexer-style whole[part]).arrow_drill_down<Algebra> from category:mereology — the operator->-based projector that exposes the carrier through the algebra's operator-> overload.The concept is non-prescriptive about which IsPartOfRelation encoding the engineer uses, which lets each named carrier choose what reads most naturally (predicate-style for thin algebra views over a primitive carrier, indexer-style for vector carriers, etc.).
Ops is a parameter pack so the concept reads at the closure tier when no operations are supplied (in which case the IsAlgebra<Carrier> requirement reduces to std::semiregular<Carrier>) and at the operations tier when concrete operations are named (in which case the operations are required to close on the carrier as well).
(A, F) pair). category:mereology for the IsPartOfRelation / arrow_drill_down primitives. IsAlgebra above for the algebra-side closure tier.| Algebra | The named-carrier type — the whole of the HAS-A. |
| Carrier | The underlying carrier — the part of the HAS-A. |
| Ops | Optional family of operations that close on Carrier. When omitted, only the closure tier is required. |
Filed under #573.