Cli.key_rank: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 2634-2644 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=2634&end_line=2644 import Base # The position of the first of keys named query, where hit says whether # keys' head is and at is its position. It only reads keys: a walk that # takes them, as find_key does, copies every field of each key it passes. def key_rank(keys: List<&2, OptKey>, +query: String, at: Nat, hit: Bool) -> Maybe<&2, Nat>: match keys hit: case Nil{} _: None{} case key <> tail True{}: Some{at} case key <> +tail False{}: next = head_named(tail, query) key_rank(tail, query, 1n+at, next) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=Nat 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=OptKey https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=head_named