ALP User Documentation 0.7.alpha
Algebraic Programming User Documentation
|
A generalised monoid. More...
#include <monoid.hpp>
Public Member Functions | |
Monoid () | |
Constructor that infers a default operator, given the operator type. | |
template<typename D > | |
constexpr D | getIdentity () const |
Retrieves the identity corresponding to this monoid. | |
Operator | getOperator () const |
Retrieves the underlying operator. | |
A generalised monoid.
_OP | The monoid operator. |
_ID | The monoid identity (the ‘0’). |
|
inline |
Constructor that infers a default operator, given the operator type.
Useful for stateless operators.
|
inlineconstexpr |
Retrieves the identity corresponding to this monoid.
The identity value will be cast to the requested domain.
D | The requested domain of the identity. |
|
inline |
Retrieves the underlying operator.