Labled tuples for derived Yojson serializers?

Assuming the . is for any unnamed component (and thus will be repeated in the list) that strikes me as a particularly bad encoding. If you take the perspective of using generic tool to process s-expressions then neither can you query this as a dictionary (assuming you have the right encoding…) nor directly as a list (tuple). The best of both worlds!

That |2| should rather read "1". I personally much prefer this encoding because:

  1. It avoids dealing with heterogenous arrays (e.g. in jsont they entail decoding to a generic representation because it optimizes for uniform arrays).
  2. It allows user friendly (named) queries.

But then this assumes you are interested in querying your serializations with generic JSON tools.