Fast.find.go: def of lawful-bytes@0.1.1.0 Import: import lawful-bytes@0.1.1.0/fast.bend as Fast Lines 51-64 of lawful-bytes@0.1.1.0/fast.bend: https://jend.leeeet.dev/read.txt?path=lawful-bytes@0.1.1.0/fast.bend&start_line=51&end_line=64 import Base # m flags word wi's hits; z: m is 0; r holds word wi + 1; n counts the words # left, wi's included. Answers the offset of the first hit, or 2^32 - 1. def find.go(n: Nat, z: Bool, r: Array & U32, +wi: U32, +m: U32, +rc: U32) -> Array & U32: match n z: case 0n _: (a, w) = r (a, 4294967295) case 1n+k True{}: (a, +w) = r +m2 = zb((w .^. rc : U32)) find.go(k, U32.is_zero(m2), Array.get(U32, a, (wi + 2 : U32)), (wi + 1 : U32), m2, rc) case 1n+k False{}: (a, w) = r (a, ((wi << 2n : U32) + bidx(m) : U32)) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.get 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=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_zero https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shln https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.xor https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/fast.bend&name=bidx https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/fast.bend&name=zb