Value.eq: def of yaml-for-bend@0.1.1.0 Import: import yaml-for-bend@0.1.1.0/value.bend as Value Lines 31-106 of yaml-for-bend@0.1.1.0/value.bend: https://jend.leeeet.dev/read.txt?path=yaml-for-bend@0.1.1.0/value.bend&start_line=31&end_line=106 import Base # Whether two values are the same: same kinds, same texts, same items and # entries in the same order. def eq(a: Yaml, b: Yaml) -> Bool: match a: case Null{}: match b: case Null{}: True{} case _: False{} case Boolean{x}: match b: case Boolean{y}: same.bool(x, y) case _: False{} case Int{x}: match b: case Int{y}: String.eq(x, y) case _: False{} case Float{x}: match b: case Float{y}: String.eq(x, y) case _: False{} case Str{x}: match b: case Str{y}: String.eq(x, y) case _: False{} case Seq{xs}: match xs: case Nil{}: match b: case Seq{ys}: List.is_empty(&2, Yaml, ys) case _: False{} case Con{x, xt}: match b: case Seq{ys}: match ys: case Nil{}: False{} case Con{y, yt}: Bool.and(eq(x, y), eq(Seq{xt}, Seq{yt})) case _: False{} case Mapping{xs}: match xs: case Nil{}: match b: case Mapping{ys}: List.is_empty(&2, Entry, ys) case _: False{} case Con{Entry{xk, xv}, xt}: match b: case Mapping{ys}: match ys: case Nil{}: False{} case Con{Entry{yk, yv}, yt}: Bool.and(Bool.and(eq(xk, yk), eq(xv, yv)), eq(Mapping{xt}, Mapping{yt})) case _: False{} case Tagged{s, x}: match b: case Tagged{t, y}: Bool.and(String.eq(s, t), eq(x, y)) case _: False{} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.is_empty 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/value.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/value.bend&name=Yaml https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/value.bend&name=same.bool