Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::category::Section< T, Op > Struct Template Referenceexport

A binary operation curried, with named arrows throughout (the Jlt paper, Listing 3): curry<T>(op) is \(T \to T^T\), its value at a the operator section \(b \mapsto op(a, b)\), Haskell's (a +), and uncurry takes it back to \(T \times T \to U\). A chain's end and step are such sections: curry<N>(greater_equal<N>{})(unit) stops at the unit, curry<N>(plus<N>{})(1) is the successor. More...

Collaboration diagram for dedekind::category::Section< T, Op >:

Public Types

using Domain = T
using Codomain

Public Member Functions

constexpr Codomain operator() (const T &b) const
constexpr bool operator== (const Section &o) const
 Two sections are equal when their elements are and, for an operation with state, their operations are; an operation with state and no == offers no equality. A stateless operation is its type.

Public Attributes

Op op
T a

Detailed Description

template<typename T, typename Op>
requires std::regular_invocable<const Op&, const T&, const T&>
struct dedekind::category::Section< T, Op >

A binary operation curried, with named arrows throughout (the Jlt paper, Listing 3): curry<T>(op) is \(T \to T^T\), its value at a the operator section \(b \mapsto op(a, b)\), Haskell's (a +), and uncurry takes it back to \(T \times T \to U\). A chain's end and step are such sections: curry<N>(greater_equal<N>{})(unit) stops at the unit, curry<N>(plus<N>{})(1) is the successor.

cartesian__Curry_Of_An_Operation

Template Parameters
Tthe carrier.
Opthe operation.

Member Typedef Documentation

◆ Codomain

template<typename T, typename Op>
using dedekind::category::Section< T, Op >::Codomain
Initial value:
std::remove_cvref_t<std::invoke_result_t<const Op&, const T&, const T&>>

Member Function Documentation

◆ operator()()

template<typename T, typename Op>
Codomain dedekind::category::Section< T, Op >::operator() ( const T & b) const
inlineconstexpr
Parameters
bthe second argument.
Returns
op(a, b).

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