def text.value.pick

ezsys@0.1.0.0 · src/text.bend:30

import ezsys@0.1.0.0/src/text.bend as Text
import Base

30# this pair's value when its key is the one asked for, else the rest's
31def text.value.pick(
32  hit: Bool,
33  value: String,
34  rest: Unit -> Maybe<&2, String>
35) -> Maybe<&2, String>:
36  match hit:
37    case True{}:
38      Some{value}
39    case False{}:
40      rest(Unit{})

Uses (4)

Used by (1)