Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::concepts::MonadicResult Concept Referenceexport

A complete Result-like type with all monadic operations. More...

#include <core.h>

Concept definition

template<typename T>
A type that supports monadic chaining (flatMap/and_then).
Definition core.h:121
A type that supports monadic map operations.
Definition core.h:99
A complete Result-like type with all monadic operations.
Definition core.h:143
A type that can contain either a value or an error.
Definition core.h:54

Detailed Description

A complete Result-like type with all monadic operations.

Combines Resultable, Unwrappable, Mappable, and Chainable concepts for types that provide full monadic error handling capabilities.

Example usage:

template<MonadicResult R>
auto process_chain(const R& result) {
return result
.map([](auto& v) { return v * 2; })
.and_then([](auto v) { return R::ok(v + 1); });
}

Definition at line 143 of file core.h.