Cli.read_check: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 4559-4564 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=4559&end_line=4564 import Base # Validation first; reading a validated value never fails (ยง6.5). def read_check(~T: Data, ~get: Field -> T, verdict: Maybe<&2, String>, fields: List<&2, Field>, id: String) -> Dec(T): match verdict: case None{}: Done{get(field_find(fields, id))} case Some{msg}: Fail{Bug{msg}} Uses (8): 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=Result 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=Dec https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Fault https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Field https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=field_find