Bin.adc: def of bend-lawful-stdlib@0.1.0.0 Import: import bend-lawful-stdlib@0.1.0.0/src/float/bin.bend as Bin Lines 77-92 of bend-lawful-stdlib@0.1.0.0/src/float/bin.bend: https://jend.leeeet.dev/read.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/bin.bend&start_line=77&end_line=92 import Base # a + b + carry, one bit at a time: bits 0+0 pass the carry through and # carry nothing, 0+1 flip it and carry it, 1+1 pass it and carry one def adc(a: Bin, b: Bin, +c: Bool) -> Bin: match a b: case BZ{} b: adc.one(b, c) case a BZ{}: adc.one(a, c) case B0{x} B0{y}: cons(c, adc(x, y, False{})) case B0{x} B1{y}: cons(Bool.not(c), adc(x, y, c)) case B1{x} B0{y}: cons(Bool.not(c), adc(x, y, c)) case B1{x} B1{y}: cons(c, adc(x, y, True{})) 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=Bool.not https://jend.leeeet.dev/definition.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/bin.bend&name=Bin https://jend.leeeet.dev/definition.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/bin.bend&name=adc.one https://jend.leeeet.dev/definition.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/bin.bend&name=cons