Numeric.mask: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/spec/lib/numeric.bend as Numeric Lines 109-117 of bend-collections-laws-math@1.0.0.0/spec/lib/numeric.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/spec/lib/numeric.bend&start_line=109&end_line=117 import Base # The low k bits set, the rest clear. def mask(+n: Nat, +k: Nat) -> Word(n): match n k: case 0n _: WNil{} case 1n+p 0n: WCon{False{}, mask(p, 0n)} case 1n+p 1n+j: WCon{True{}, mask(p, j)} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil