Cli.find_by_key_go: def of cli@0.2.0.0
Import: import cli@0.2.0.0/cli.bend as Cli
Lines 4717-4725 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=4717&end_line=4725
import Base
# The value under the first key equal to key; after a hit it walks no further.
def find_by_key_go(a, -A: Kind(a), keys: List<&2, String>,
values: List, +key: String, found: Maybe) -> Maybe:
match keys values found:
case _ _ Some{hit}: Some{hit}
case head <> tail value <> rest None{}:
find_by_key_go(a, A, tail, rest, key,
by_key_hit(a, A, same_text(head, key), value))
case _ _ None{}: None{}
Uses (5):
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String
https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=by_key_hit
https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=same_text