def find_by_key_go

cli@0.2.0.0 · cli.bend:4717

import cli@0.2.0.0/cli.bend as Cli
import Base

4717# The value under the first key equal to key; after a hit it walks no further.
4718def find_by_key_go(a, -A: Kind(a), keys: List<&2, String>,
4719    values: List<a, A>, +key: String, found: Maybe<a, A>) -> Maybe<a, A>:
4720  match keys values found:
4721    case _ _ Some{hit}: Some{hit}
4722    case head <> tail value <> rest None{}:
4723      find_by_key_go(a, A, tail, rest, key,
4724        by_key_hit(a, A, same_text(head, key), value))
4725    case _ _ None{}: None{}

Uses (5)

Used by (1)