Natural.clamp_ok: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/math/natural.bend as Natural Lines 340-345 of bend-collections@1.0.0.0/src/math/natural.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/math/natural.bend&start_line=340&end_line=345 import Base def clamp_ok(+x: Nat, +lo: Nat, +hi: Nat, +bad: Bool) -> Result<&2, &2, MathError, Nat>: match bad: case True{}: Fail{Domain{}} case False{}: Done{Nat.min(Nat.max(x, lo), hi)} 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=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.max https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.min https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/natural.bend&name=MathError