def first
import lawful-bytes@0.1.1.0/defs.bend as Defsimport Base
73# The first index j with from <= j < to where xs has c; to if there is none
74# (for from <= to <= length(xs), as the laws assume).
75def first(xs: List<&2, U32>, +from: Nat, +to: Nat, +c: U32) -> Nat:
76 Nat.add(from, run_len(slice(xs, from, Nat.sub(to, from)), c))