Input.unique.step: def of bend-kit-camber@0.15.0.1 Import: import bend-kit-camber@0.15.0.1/input.bend as Input Lines 247-270 of bend-kit-camber@0.15.0.1/input.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-camber@0.15.0.1/input.bend&start_line=247&end_line=270 import Base import bend-kit-json@0.7.0.0/json.bend as Json import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes def unique.step(step: Walk) -> Maybe<&1, Walk>: match step: case Value{value, parents}: match value: case Json.Obj{fields}: Some{Fields{fields, Nil{}, Set.new(), parents}} case Json.Arr{values}: Some{Items{values, Nil{}, parents}} case Json.Null{}: Some{Returned{Json.Null{}, parents}} case Json.Flag{on}: Some{Returned{Json.Flag{on}, parents}} case Json.Num{number}: Some{Returned{Json.Num{number}, parents}} case Json.Str{text}: Some{Returned{Json.Str{text}, parents}} case Fields{fields, acc, seen, parents}: match fields: case Nil{}: Some{Returned{Json.Obj{List.reverse(&1, Bytes.Bytes & Json.Val, acc)}, parents}} case (key, value) <> rest: unique.borrowed(utf8.borrow(key), value, rest, acc, seen, parents) case Items{values, acc, parents}: match values: case Nil{}: Some{Returned{Json.Arr{List.reverse(&1, Json.Val, acc)}, parents}} case value <> rest: Some{Value{value, Array{rest, acc} <> parents}} case Returned{value, parents}: match parents: case Nil{}: Some{Returned{value, Nil{}}} case Object{key, rest, acc, seen} <> parents: Some{Fields{rest, (key, value) <> acc, seen, parents}} case Array{rest, acc} <> parents: Some{Items{rest, value <> acc, parents}} Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Set.new https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/input.bend&name=Parent https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/input.bend&name=Walk https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/input.bend&name=unique.borrowed https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/input.bend&name=utf8.borrow https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=Val