Value.wf.go: def of emerging-ezjson@1.3.0.0 Import: import emerging-ezjson@1.3.0.0/src/value.bend as Value Lines 357-387 of emerging-ezjson@1.3.0.0/src/value.bend: https://jend.leeeet.dev/read.txt?path=emerging-ezjson@1.3.0.0/src/value.bend&start_line=357&end_line=387 import Base import emerging-ezjson@1.3.0.0/src/lazy.bend as Lazy # whether a value, or a chain of cells, has the shape the parser and the # builders give: arrays and objects are chains of cells ending in JNil, no # cell stands where a value belongs, and a number's text is a JSON number def wf.go(val: Json, shape: Shape) -> Bool: match val shape: case JNull{} WVal{}: True{} case JBool{_} WVal{}: True{} case JNum{raw} WVal{}: num.ok(raw) case JStr{_} WVal{}: True{} case JSpan{_, _} WVal{}: True{} case JArr{items} WVal{}: wf.go(items, WArr{}) case JObj{pairs} WVal{}: wf.go(pairs, WObj{}) case JNil{} WArr{}: True{} case JCons{hd, tl} WArr{}: Lazy.stop(Bool, Bool.not(wf.go(hd, WVal{})), False{}, _u => wf.go(tl, WArr{})) case JNil{} WObj{}: True{} case JPair{_, vv, rr} WObj{}: Lazy.stop(Bool, Bool.not(wf.go(vv, WVal{})), False{}, _u => wf.go(rr, WObj{})) case JBind{_, _, vv, rr} WObj{}: Lazy.stop(Bool, Bool.not(wf.go(vv, WVal{})), False{}, _u => wf.go(rr, WObj{})) case _ _: False{} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lazy.bend&name=stop https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/value.bend&name=Json https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/value.bend&name=Shape https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/value.bend&name=num.ok