Fold.size: def of bend-toon-codec@0.1.0.0 Import: import bend-toon-codec@0.1.0.0/src/fold.bend as Fold Lines 81-93 of bend-toon-codec@0.1.0.0/src/fold.bend: https://jend.leeeet.dev/read.txt?path=bend-toon-codec@0.1.0.0/src/fold.bend&start_line=81&end_line=93 import Base import bend-toon-codec@0.1.0.0/src/json.bend as J # Nodes in a value: the fuel for the fold. def size(+j: J.Json) -> Nat: match j: case J.JArr{x}: 1n+size(x) case J.JObj{x}: 1n+size(x) case J.JCons{h, t}: 1n+Nat.add(size(h), size(t)) case J.JField{k, v, t}: 1n+Nat.add(size(v), size(t)) case _: 1n Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=bend-toon-codec@0.1.0.0/src/json.bend&name=Json