Generic.clamp: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/src/math/generic.bend as Generic Lines 93-95 of bend-collections-laws-math@1.0.0.0/src/math/generic.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/src/math/generic.bend&start_line=93&end_line=95 import Base import bend-collections-laws-math@1.0.0.0/src/math/num.bend as N # min(max(x, lo), hi); hi < lo is a Domain error def clamp(~T: Data, ~op: N.Op -> T, ~test: N.Test -> Bool, +x: T, +lo: T, +hi: T) -> Result<&2, &2, N.NumError, T>: clamp_ok(~T, ~op, ~test, x, lo, hi, test(N.Lt{hi, lo})) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/generic.bend&name=clamp_ok https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/num.bend&name=NumError https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/num.bend&name=Op https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/num.bend&name=Test