def rep.fin
import bend-kit-regex@0.8.0.0/regex.bend as Regeximport Base
460def rep.fin(max: Maybe<&2, U32>, +min: U32, +g: Bool, +h: Node) -> Node:
461 match max:
462 case None{}:
463 rep.inf(U32.to_nat(min), g, h)
464 case Some{m}:
465 rep.copies(U32.to_nat(min), h, rep.opt(U32.to_nat((m - min : U32)), g, h))