def min
import bend-collections-laws-math@1.0.0.0/src/math/generic.bend as Genericimport Base
import bend-collections-laws-math@1.0.0.0/src/math/num.bend as N
79# Python's min(a, b) keeps a unless b < a; max keeps a unless a < b.
80def min(~T: Data, ~op: N.Op<T> -> T, ~test: N.Test<T> -> Bool, +a: T, +b: T) -> T:
81 pick(T, test(N.Lt{b, a}), b, a)
Uses (4)
Used by (7)
- bend-collections-laws-math@1.0.0.0/src/math/generic:clamp_ok
- bend-collections-laws-math@1.0.0.0/spec/math/generic:Min.agrees
- bend-collections-laws-math@1.0.0.0/src/math/generic:comb_big
- bend-collections-laws-math@1.0.0.0/spec/math/generic:FMin.select
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32:clamp_c
- …