Zulip Chat Archive

Stream: lean4

Topic: 2 simple JSON questions


Julian Berman (Jun 29 2022 at 13:11):

Do these instances belong in Lean, and/or is the recursion gymnastics I assume is necessary to prove them the reason they're not there?

instance {a₁ a₂ : Array Json} : Decidable (a₁ = a₂) := sorry
instance {o₁ o₂ : RBNode String fun x => Json} : Decidable (o₁ = o₂) := sorry
instance : DecidableEq Json := λ a b => by cases a <;> cases b <;> simp <;> infer_instance

Also, for my edification, is there a benefit to making JSON objects RBMap / RBNodes vs PersistentHashMaps?

Arthur Paulino (Jun 29 2022 at 13:14):

RB structures should exclude the possibility of hash collisions with certainty, that's one advantage


Last updated: Dec 20 2023 at 11:08 UTC