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
template <typename Expr, typename TF>
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); });
}
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