def occurrences
import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/brew/ops.bend as Opsimport Base
75def occurrences(xs: List<&2, String>, +x: String) -> Nat:
76 match xs:
77 case []:
78 0n
79 case y <> rest:
80 Nat.add(Bool.pick(Nat, String.eq(x, y), 1n, 0n), occurrences(rest, x))