Int.Int.bits.go: def of bend-kit-int@0.2.0.0 Import: import bend-kit-int@0.2.0.0/int.bend as Int Lines 4-11 of bend-kit-int@0.2.0.0/int.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-int@0.2.0.0/int.bend&start_line=4&end_line=11 import Base # The Int.* core serves only U64 and I64. When Base ships a native U64 (bendlang/bend#1027), delete it. def Int.bits.go(n: Nat, qr: Nat & Nat) -> Word(n): match n: case 0n: WNil{} case 1n+p: (q, r) = qr WCon{Nat.is_eq(r, 1n), Int.bits.go(p, Nat.divmod(q, 2n))} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.divmod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil