def sq_val
import bend-collections@1.0.0.0/src/math/generic.bend as Genericimport Base
import bend-collections@1.0.0.0/src/math/num.bend as N
150# the base squared, only while higher exponent bits remain
151def sq_val(~T: Data, ~op: N.Op<T> -> T, more: Bool, +b: T) -> T:
152 match more:
153 case False{}:
154 b
155 case True{}:
156 op(N.Mul{b, b})