Core.read: def of yaml-for-bend@0.1.1.0 Import: import yaml-for-bend@0.1.1.0/core.bend as Core Lines 144-152 of yaml-for-bend@0.1.1.0/core.bend: https://jend.leeeet.dev/read.txt?path=yaml-for-bend@0.1.1.0/core.bend&start_line=144&end_line=152 import Base import yaml-for-bend@0.1.1.0/value.bend as V # A scalar's text read by a known tag: "!" and !!str are a string, and # !!null, !!bool, !!int and !!float must be one. def read(+tag: String, +s: String) -> Result<&2, &2, String, V.Yaml>: when(Result<&2, &2, String, V.Yaml>, Bool.or(String.eq(tag, "!"), String.eq(tag, yaml.tag("str"))), u => Done{V.Str{s}}, u => when(Result<&2, &2, String, V.Yaml>, String.eq(tag, yaml.tag("null")), u => must(Bool.pick(Maybe<&2, V.Yaml>, is_null(s), Some{V.Null{}}, None{}), "!!null", s), u => when(Result<&2, &2, String, V.Yaml>, String.eq(tag, yaml.tag("bool")), u => must(Bool.pick(Maybe<&2, V.Yaml>, is_true(s), Some{V.Boolean{True{}}}, Bool.pick(Maybe<&2, V.Yaml>, is_false(s), Some{V.Boolean{False{}}}, None{})), "!!bool", s), u => when(Result<&2, &2, String, V.Yaml>, String.eq(tag, yaml.tag("int")), u => must(int.yaml(int.of(s)), "!!int", s), u => must(float.yaml(float.of(s), int.of(s)), "!!float", s))))) Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick 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=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=float.of https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=float.yaml https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=int.of https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=int.yaml https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=is_false https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=is_null https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=is_true https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=must https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=when https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=yaml.tag https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/value.bend&name=Yaml