def trim_first

bend-edit-distance@0.2.2.0 · src/Myers.bend:278

import bend-edit-distance@0.2.2.0/src/Myers.bend as Myers
import Base

278def trim_first(entries: List<&2, BandEntry>, +rest: List<&2, Peq>, +first: Nat,
279               +maximum: Nat, +length: Nat, +target_length: Nat,
280               +column: Nat) -> Band:
281  match entries:
282    case Nil{}:
283      Band{first, Nil{}, rest}
284    case BandEntry{profile, Block{pv, mv, +score}} <> +tail:
285      trim_first.step(BandEntry{profile, Block{pv, mv, score}}, tail, rest,
286        first,
287        band_keep_first(U32.to_nat(score), Nat.mul(1n+first, 32n),
288          maximum, length, target_length, column),
289        _ => trim_first(tail, rest, 1n+first, maximum, length, target_length, column))

Uses (10)

Used by (1)