def occurrences

near-v-framework@0.4.0.0 · domain/architecture/system/deployment/nix_darwin/brew/ops.bend:75

import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/brew/ops.bend as Ops
import 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))

Uses (6)

Used by (1)