lager
lager copied to clipboard
Allow mixing cursors and readers into a cursor node
Consider:
cursor<vector<T>> collection = ...;
reader<size_t> identifier = ...;
cursor<T> element = with(collection, identifier).xform(
zug::map([](vector<T> vect, size_t index) -> T {
return view(at(index), vect);
}),
lager::update([](tuple<vector<T>, size_t> whole, T part) -> vector<T> {
return set(at(whole.second), whole.first, part);
}));
Alternatively, converting a reader node into a cursor that discards any writes would be acceptable.