The chain in arrows (the Jlt paper, Listing 3). Three arrows make it: an end, a predicate on the states; a step, an endo; a seed, a point. until(end, step) is the guard, after the Haskell Prelude's until, the partial step \(N \to 1 + N\) a cartesian category builds as \(\langle end,
1\rangle ; dist ; (! + step)\). chain(out) is the anamorphism as an arrow \(N \to N^*\), so a seed composed into it, x >> chain(out), is its chain. ns >> f is the functor's action, f mapped over the elements, the coalgebra's emitted leg post-composed, \((1 + f \times 1) \circ
out\), and map id is the chain itself, decided at the type. A fold over the composite is a hylomorphism: nothing between the seed and the fold is built.
More...
|
|
using | Domain = Dom<Step> |
|
using | Codomain = std::optional<Domain> |
|
| constexpr Codomain | operator() (const Domain &n) const |
|
constexpr bool | operator== (const Until &) const =default |
template<IsArrow End, IsArrow Step>
requires std::same_as<
Dom<End>,
Dom<
Step>> && std::same_as<
Cod<
Step>,
Dom<
Step>> && std::convertible_to<
Cod<End>, bool>
struct dedekind::category::Until< End, Step >
The chain in arrows (the Jlt paper, Listing 3). Three arrows make it: an end, a predicate on the states; a step, an endo; a seed, a point. until(end, step) is the guard, after the Haskell Prelude's until, the partial step \(N \to 1 + N\) a cartesian category builds as \(\langle end,
1\rangle ; dist ; (! + step)\). chain(out) is the anamorphism as an arrow \(N \to N^*\), so a seed composed into it, x >> chain(out), is its chain. ns >> f is the functor's action, f mapped over the elements, the coalgebra's emitted leg post-composed, \((1 + f \times 1) \circ
out\), and map id is the chain itself, decided at the type. A fold over the composite is a hylomorphism: nothing between the seed and the fold is built.
chain__Chain_As_Arrows
◆ operator()()
template<IsArrow End, IsArrow Step>
- Parameters
-
- Returns
- nothing at the end, else the step of
n.
The documentation for this struct was generated from the following file: