boostorg / boostorg/yap

Suggestion: repeated transform

Open
#92 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
108
Forks
32
PR merge metrics
No merged PRs in 30d

Description

Dear Zach,

How about adding a "repeated transform"? (See below, not sure if this is the best form, maybe some perfect forwarding is needed).
Note that it requires the Comparable concept on Expr.

best,
Niek

```cpp
template
constexpr auto repeated_transform(Expr &&expr, TF&& xform) {
// apply the transform repeatedly until the result no longer changes

return hana::while_(
[&](auto &&x) { return hana::not_equal(x, yap::transform(x, xform)); },
expr, [&](auto &&ex) { return yap::transform(ex, xform); });
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the proposed repeated_transform snippet and the existing hana::while_ and yap::transform APIs. Confirm how Expr comparison and forwarding are handled, then define and test behavior for repeatedly applying a transform until the expression no longer changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.