Myers.build_peq_word: def of bend-edit-distance@0.2.2.0 Import: import bend-edit-distance@0.2.2.0/src/Myers.bend as Myers Lines 37-46 of bend-edit-distance@0.2.2.0/src/Myers.bend: https://jend.leeeet.dev/read.txt?path=bend-edit-distance@0.2.2.0/src/Myers.bend&start_line=37&end_line=46 import Base import bend-edit-distance@0.2.2.0/EdlibTypes.bend as E # Bit i matches query[i] literally or through an explicit symmetric pair. # Unused high bits are wildcards regardless of the pairs, as in buildPeq. def build_peq_word(query: String, +symbol: Char, +bit: U32, +pairs: List<&2, E.EqualityPair>) -> U32: match query: case SNil{}: U32.not(U32.sub(bit, 1)) case SCon{h, t}: (U32.mul(Bool.to_u32(E.equal(pairs, h, symbol)), bit) .|. build_peq_word(t, symbol, U32.shl(bit), pairs) : U32) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.to_u32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shl https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/EdlibTypes.bend&name=EqualityPair https://jend.leeeet.dev/definition.txt?path=bend-edit-distance@0.2.2.0/EdlibTypes.bend&name=equal