Expand.ex: def of bend-toon-codec@0.1.0.0 Import: import bend-toon-codec@0.1.0.0/src/expand.bend as Expand Lines 184-199 of bend-toon-codec@0.1.0.0/src/expand.bend: https://jend.leeeet.dev/read.txt?path=bend-toon-codec@0.1.0.0/src/expand.bend&start_line=184&end_line=199 import Base import bend-toon-codec@0.1.0.0/src/json.bend as J # `acc` is the object under construction while walking a field chain, and # Done{JNil} while walking an array's elements. def ex(+j: J.Json, +acc: Result<&2, &2, String, J.Json>, +strict: Bool) -> Result<&2, &2, String, J.Json>: match j: case J.JObj{fs}: ex(fs, init(), strict) case J.JField{k, v, t}: ex(t, fl.r(ex(v, init(), strict), segs_of(k), acc, strict), strict) case J.JNil{}: acc case J.JArr{items}: arr.r(ex(items, nil(), strict)) case J.JCons{h, t}: cons.r(ex(h, init(), strict), ex(t, nil(), strict)) case _: Done{j} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=bend-toon-codec@0.1.0.0/src/expand.bend&name=arr.r https://jend.leeeet.dev/definition.txt?path=bend-toon-codec@0.1.0.0/src/expand.bend&name=cons.r https://jend.leeeet.dev/definition.txt?path=bend-toon-codec@0.1.0.0/src/expand.bend&name=fl.r https://jend.leeeet.dev/definition.txt?path=bend-toon-codec@0.1.0.0/src/expand.bend&name=init https://jend.leeeet.dev/definition.txt?path=bend-toon-codec@0.1.0.0/src/expand.bend&name=nil https://jend.leeeet.dev/definition.txt?path=bend-toon-codec@0.1.0.0/src/expand.bend&name=segs_of https://jend.leeeet.dev/definition.txt?path=bend-toon-codec@0.1.0.0/src/json.bend&name=Json