Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::category::StepCoalgebra< X, Step > Struct Template Referenceexport

The coalgebra of a partial step \(X \to 1 + X\): the element, and the step as the next state, while the step has a value. Turns Prior, lower_cover or cover into a lens. More...

Collaboration diagram for dedekind::category::StepCoalgebra< X, Step >:

Public Member Functions

constexpr std::optional< std::pair< X, X > > operator() (const X &x) const
constexpr bool operator== (const StepCoalgebra &) const =default

Public Attributes

Step step {}

Detailed Description

template<std::regular X, std::semiregular Step>
requires std::regular_invocable<const Step&, const X&> && std::same_as<std::invoke_result_t<const Step&, const X&>, std::optional<X>>
struct dedekind::category::StepCoalgebra< X, Step >

The coalgebra of a partial step \(X \to 1 + X\): the element, and the step as the next state, while the step has a value. Turns Prior, lower_cover or cover into a lens.

Template Parameters
Xthe carrier.
Stepthe partial step.

Member Function Documentation

◆ operator()()

template<std::regular X, std::semiregular Step>
std::optional< std::pair< X, X > > dedekind::category::StepCoalgebra< X, Step >::operator() ( const X & x) const
inlineconstexpr
Parameters
xa state.
Returns
(step(x), step(x)), the element the step lands on, as element and as next state, or nothing where the step has nothing: the chain of x is what the step reaches from x, and x itself is not among them (the Jlt paper's Figure 2, after Lambek).

The documentation for this struct was generated from the following file: