Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::category::detail_comprehension Namespace Reference

Classes

struct  StepFrom
 A fold step with its accumulator bound, \(a \mapsto \mathit{op}(\mathit{acc}, a)\): the present case of the eliminator. More...
struct  Tally
 One more element into a count. More...
struct  Extended
 A Kleisli arrow into Maybe extended to the elements of a query, \(\kappa(-, f) : \mathit{Maybe}\,A \to \mathit{Maybe}\,B\). More...
struct  SubrangeAt
struct  KernelAt
 The kernel at one more prefix. More...
struct  LengthOf
 A kernel for the laws: a prefix's length. More...
struct  KeepsWhatItClassifies
struct  JoinWithStage
struct  CountingStage
struct  Counted
 The count of a query, as Maybe's action: a query that may not be, counted where it is. More...
struct  ascends_by_position
 The trait behind AscendsByPosition: an arrow over the positions whose present elements rise with the position, so that a query read through it is sorted by construction. A struct, so that a family registers by one partial specialisation. More...
struct  ascends_by_position< Where< P > >
 where keeps the positions it keeps: a filtered chain is a chain in the same order. More...
struct  One
 An element's share of a take: one if present, none for a hole, read through Maybe's eliminator. More...
struct  Taken
 The coalgebra of take<K>: the walk, until K elements are present. One more state, the count so far; O(1), no storage. More...
struct  element_of
 The value a query's element carries: the Maybe's, or the element itself in a plain sequence. More...
struct  element_of< Maybe< T > >
struct  Read
 The coalgebra reading a bounded list position by position, each element present: a value on the stack walked as any query, so every stage composes after it. More...
struct  Pending
 order_by without a law to read, pending its take: it needs the whole query, so only the fused order_by >> take<K> is offered, never the sort alone (it would need the caller's buffer). More...
struct  Before
 Whether a ranks before b. More...
struct  KeepBest
 One more element into the best K so far, sorted by the rank: inserted after those it does not rank before, so ties keep the walk's order, and the last cut where the list overflows. O(K) on the stack. More...
struct  Progression
 The progression \(j \mapsto m j + r\), a residue class's members in order: a congruence filter on a chain read as a chain of its own. More...
struct  bound_of
 The most elements a walk presents: a take's K, or a bounded list's, kept by each SELECT and WHERE after it (a map presents no more than it reads). No member where nothing bounds the walk. More...
struct  bound_of< Taken< S, Coalg, K > >
struct  bound_of< Read< T, K > >
struct  bound_of< Mapped< S, Coalg, F > >

Concepts

concept  IsMaybe
concept  ReadsItsElements
 A stage that reads a query's elements: an arrow out of the type its present elements have.
concept  IsForeignView
 A view of the caller's, not one of the library's walks.
concept  AscendsByPosition
concept  KeptByTheWalk
 The walk's own order already is Order's under Rank: the chain descends by prior, so its elements fall along it, and a monotone rank under descending, or an antitone one under ascending, keeps them in order. order_by is then the identity.
concept  ReversedByTheWalk
 The walk's order is Order's reversed: order_by is the query re-rooted on the ascending slice, read upwards.
concept  IsBounded

Typedefs

using Evens = Subobject<std::size_t, Congruent<>>

Functions

constexpr void refuse_window_width ()
 Refuses a window of no letters, or wider than a range's distance type counts: the standard's slide has no such view.
template<std::ranges::view R>
requires std::ranges::random_access_range<R> && std::ranges::sized_range<R>
constexpr auto sliding (R r, std::size_t n)
constexpr bool lazy_is_the_functor ()
template<typename T>
constexpr std::size_t present (const Maybe< T > &e)
template<typename T>
constexpr std::size_t present (const T &)
template<std::semiregular T, std::size_t K>
constexpr unfold_view< std::size_t, Read< T, K > > walk (const AtMost< T, K > &list)
template<std::size_t K, typename Q, typename Rank, typename Order>
constexpr auto fused_take (Pending< Q, Rank, Order > p)
 The fused plan of order_by >> take<K> with no law: one pass keeping the best K, the elements present. The pending query is owned, so a range iterable only when mutable folds too.
template<IsArrow F, typename J, IsCountWord N>
constexpr bool fits_the_word (const Compose< F, Counting< J > > &rank, N l)
 Whether a rank of lengths stays exact from length l on: its values do not grow there, so the largest is at l, and it fits the rank's word, the count's, where its factors say so (bits_needed): the product law's extent, decided by one count, before any is compared.

Variables

template<typename T>
constexpr bool is_maybe_v = false
 Whether T is a Maybe: an element of a query, or none.
template<typename T>
constexpr bool is_maybe_v< Maybe< T > > = true
template<typename R>
constexpr bool is_walk_v = false
template<std::regular S, std::semiregular Coalg>
constexpr bool is_walk_v< unfold_view< S, Coalg > > = true
constexpr std::array< std::size_t, 3 > history_witness {7, 8, 9}
constexpr std::array< std::size_t, 5 > functor_witness {0, 1, 2, 3, 4}
constexpr std::array< std::byte, 6 > gaattc

Detailed Description

The caller's ranges

A range of the caller's, a genome's bytes or a series of prices, is read where it is, never copied, and a stage on it is the standard's own view: r >> f is std::views::transform, r >> windows(n) is std::views::slide. A spelling in the arrow vocabulary, not a new type: the types are the standard's, as the witnesses below check. A view is taken by value, as Rule 1 asks; a container is read through a std::span or std::views::all of it, by the caller, so no stage borrows a temporary. The library's own walks keep their >>.

Function Documentation

◆ fused_take()

template<std::size_t K, typename Q, typename Rank, typename Order>
auto dedekind::category::detail_comprehension::fused_take ( Pending< Q, Rank, Order > p)
constexpr

The fused plan of order_by >> take<K> with no law: one pass keeping the best K, the elements present. The pending query is owned, so a range iterable only when mutable folds too.

Parameters
pthe pending sort.
Returns
the best K, best first, as a query.

◆ walk()

template<std::semiregular T, std::size_t K>
unfold_view< std::size_t, Read< T, K > > dedekind::category::detail_comprehension::walk ( const AtMost< T, K > & list)
constexpr
Parameters
lista bounded list.
Returns
it as a query.

Variable Documentation

◆ gaattc

std::array<std::byte, 6> dedekind::category::detail_comprehension::gaattc
constexpr
Initial value:
{std::byte{'G'}, std::byte{'A'},
std::byte{'A'}, std::byte{'T'},
std::byte{'T'}, std::byte{'C'}}