ALP User Documentation 0.7.0
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. More... | |
template<typename D > | |
constexpr D | getIdentity () const |
Retrieves the identity corresponding to this monoid. More... | |
Operator | getOperator () const |
Retrieves the underlying operator. More... | |
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.