def first

lawful-bytes@0.1.1.0 · defs.bend:73

import lawful-bytes@0.1.1.0/defs.bend as Defs
import 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))

Uses (7)

Used by (18)