def hex.next
import bend-toon-codec@0.1.0.0/src/text.bend as Textimport Base
191def hex.next(+m: Maybe<&2, U32>, +k: U32, +acc: U32) -> Us:
192 match m:
193 case None{}:
194 UN{}
195 case Some{h}:
196 us.pick(U32.is_eq(k, 1), UN{}, UH{(k - 1 : U32), (((acc << 4n) : U32) + h : U32)})