def providers

near-architecture@0.9.1.0 · arc.bend:575

import near-architecture@0.9.1.0/arc.bend as Arc
import Base

575# Keys of the containers that provide `want`.
576def providers(+want: Cap, xs: List<&2, Container>) -> List<&2, String>:
577  match xs:
578    case []:
579      []
580    case +c <> rest:
581      cons_if(Nat.is_gt(count_in(want, caps(c)), 0n), ckey(c), providers(want, rest))

Uses (9)

Used by (1)