Defs.run_len: def of lawful-bytes@0.1.1.0 Import: import lawful-bytes@0.1.1.0/defs.bend as Defs Lines 57-63 of lawful-bytes@0.1.1.0/defs.bend: https://jend.leeeet.dev/read.txt?path=lawful-bytes@0.1.1.0/defs.bend&start_line=57&end_line=63 import Base # How many leading elements are not c. def run_len(xs: List<&2, U32>, +c: U32) -> Nat: match xs: case Nil{}: 0n case Con{+x, t}: Bool.pick(Nat, U32.is_eq(x, c), 0n, Nat.add(1n, run_len(t, c))) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq