Functional wrapper that accumulates state during a transformation chain. More...
#include <kumi/functional/monadic.hpp>
Functional wrapper that accumulates state during a transformation chain.
kumi::scannable tracks both a current value and a transformation history. As the value is piped through callables, the previous state is bound into the underlying function, effectively performing a "scan" or "prefix sum" at the type level.
| F | The accumulated function state (partial applications). |
| V | The current result value. |
Public Member Functions | |
| constexpr decltype(auto) | operator() () const noexcept |
| Finalizes the scan. | |
Friends | |
| template<typename C> | |
| constexpr decltype(auto) | operator<< (C &&c, scannable &&s) |
| Pipelines the current value into a unary callable and accumulates the operation into the function state, chaining computations from right to left. | |
| template<typename C> | |
| constexpr decltype(auto) | operator>> (scannable &&s, C &&c) |
| Pipelines the current value into a unary callable and accumulates the operation into the function state, chaining computations from left to right. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename F, typename T> | |
| scannable (F &&f, T &&t) -> scannable< F, std::unwrap_ref_decay_t< T > > | |
| kumi::function::scannable deduction guide | |