Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::sequences::Path< T, Cardinality, Index > Class Template Referenceexport

A sequence F: ℕ → T. More...

Inheritance diagram for dedekind::sequences::Path< T, Cardinality, Index >:

Classes

struct  const_iterator

Public Types

using Domain = Index
using Codomain = T
using cardinality_type = Cardinality
using index_type = Index

Public Member Functions

constexpr Codomain operator() (Index i) const
constexpr T at (Index i) const
constexpr std::size_t size () const noexcept
constexpr auto begin () const noexcept
constexpr auto end () const noexcept
constexpr auto cardinality () const noexcept
 The Path is generally viewed as a mapping from N.

Public Attributes

std::function< T(Index)> generator
 The underlying mapping f(n).
std::size_t extent = 0

Friends

constexpr Path operator+ (Path const &a, Path const &b)
constexpr Path operator- (Path const &a, Path const &b)
constexpr Path operator- (Path const &a)
constexpr Path operator* (T const &s, Path const &a)
constexpr Path operator* (Path const &a, T const &s)
template<typename F>
requires dedekind::category::IsArrow<std::remove_cvref_t<F>> && std::same_as<dedekind::category::Dom<std::remove_cvref_t<F>>, T> && requires { typename dedekind::category::Cod< std::remove_cvref_t<F>>::Codomain; } && std::same_as<dedekind::category::Cod<std::remove_cvref_t<F>>, Path<typename dedekind::category::Cod< std::remove_cvref_t<F>>::Codomain, Cardinality, Index>>
constexpr auto operator>>= (const Path &m, F &&f)
 Bind (>>=): m >>= f, for a Kleisli arrow f: T → Path, a path of this one's cardinality and index.
template<typename F>
requires dedekind::category::IsArrow<std::remove_cvref_t<F>> && std::same_as<dedekind::category::Dom<std::remove_cvref_t<F>>, Path<T, Cardinality, Index>>
constexpr auto operator<<= (const Path &w, F &&f)
 Extend (<<=): w <<= f, for a co-Kleisli arrow f: Path<T> → U.

Detailed Description

template<typename T, typename Cardinality = ℵ_0, dedekind::sets::IsRingIntegral Index = std::size_t>
class dedekind::sequences::Path< T, Cardinality, Index >

A sequence F: ℕ → T.

Template Parameters
TThe Species being enumerated.
CardinalityThe cardinality tag (ℵ_0 for infinite, Finite for bounded).
IndexThe carrier of the Domain — any IsRingIntegral inhabitant, defaulting to std::size_t for back-compat with all existing call sites. The Form-shaped choices are dedekind::sets::ExtensionalCardinal<> (the algebraically-certified finite ℕ carrier) and dedekind::sets::Cardinality (the variant ℕ Form). Closes the Sollbruchstelle documented on this struct historically ("Path::Domain currently @c std::size_t — once generalised, @c Cardinality is what makes the @c size_t choice principled rather than accidental").

Member Function Documentation

◆ at()

template<typename T, typename Cardinality = ℵ_0, dedekind::sets::IsRingIntegral Index = std::size_t>
T dedekind::sequences::Path< T, Cardinality, Index >::at ( Index i) const
inlineconstexpr

path__Sequence_Interface

◆ operator+

template<typename T, typename Cardinality = ℵ_0, dedekind::sets::IsRingIntegral Index = std::size_t>
Path operator+ ( Path< T, Cardinality, Index > const & a,
Path< T, Cardinality, Index > const & b )
friend

path__Pointwise_Operators

Path<T, Cardinality> is a function space T^ℕ (or T^[0..N) in the finite case): pointwise +, scalar ·, and unary - give the vector-space surface a function space carries. This is the operator anchor for #537's IsFunctionSpace<W, D, T> concept. Each operation produces a fresh Path whose generator captures the operands intensionally — no eager materialisation of values.

◆ operator<<=

template<typename T, typename Cardinality = ℵ_0, dedekind::sets::IsRingIntegral Index = std::size_t>
template<typename F>
requires dedekind::category::IsArrow<std::remove_cvref_t<F>> && std::same_as<dedekind::category::Dom<std::remove_cvref_t<F>>, Path<T, Cardinality, Index>>
auto operator<<= ( const Path< T, Cardinality, Index > & w,
F && f )
friend

Extend (<<=): w <<= f, for a co-Kleisli arrow f: Path<T> → U.

path__Co_Kleisli_Triple

◆ operator>>=

template<typename T, typename Cardinality = ℵ_0, dedekind::sets::IsRingIntegral Index = std::size_t>
template<typename F>
requires dedekind::category::IsArrow<std::remove_cvref_t<F>> && std::same_as<dedekind::category::Dom<std::remove_cvref_t<F>>, T> && requires { typename dedekind::category::Cod< std::remove_cvref_t<F>>::Codomain; } && std::same_as<dedekind::category::Cod<std::remove_cvref_t<F>>, Path<typename dedekind::category::Cod< std::remove_cvref_t<F>>::Codomain, Cardinality, Index>>
auto operator>>= ( const Path< T, Cardinality, Index > & m,
F && f )
friend

Bind (>>=): m >>= f, for a Kleisli arrow f: T → Path, a path of this one's cardinality and index.

path__Kleisli_Triple


The documentation for this class was generated from the following file:
  • src/main/modules/dedekind/sequences/path.cppm