def inv_one
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
578def inv_one(~T: Data, ~op: N.Op<T> -> T, +m: T, +s: T, one: Bool) -> Result<&2, &2, N.NumError, T>:
579 match one:
580 case True{}:
581 Done{op(N.Rem{s, m})}
582 case False{}:
583 Fail{N.NoInverse{}}