def index_of
import cswap-bend-cli@0.1.0.0/swpick.bend as Swpickimport Base
71def index_of(+xs: List<&2, String>, +x: String, +i: Nat) -> Nat:
72 match xs:
73 case Nil{}:
74 0n
75 case Con{h, t}:
76 sel_n(String.eq(h, x), i, index_of(t, x, 1n+i))