Numeric.Numeric.encode: def of gralha-bendquest@0.1.0.0 Import: import gralha-bendquest@0.1.0.0/numeric.bend as Numeric Lines 13-19 of gralha-bendquest@0.1.0.0/numeric.bend: https://jend.leeeet.dev/read.txt?path=gralha-bendquest@0.1.0.0/numeric.bend&start_line=13&end_line=19 import Base # Generalization of Base.U32.from_nat to arbitrary word widths. def Numeric.encode(+n: Nat, k: Nat) -> Word(n): match k: case Zero{}: Word.zero(n) case Succ{p}: Word.inc(n, Numeric.encode(n, p)) Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.inc https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.zero