Open majkrzak opened 2 years ago
Is this a feature request?
Depend how to treat it. According to https://yaml.org/spec/1.2.2/#3221-mapping-key-order mapping key order is not important, but from the point of readability is.
I agree that preserving the field order is desirable. I'd be happy to accept a PR that implements this.
I think we need to be a bit careful not to introduce a performance regression with this though:
A simple list of pairs might be too slow during lookups:
type Mapping loc = [(Node loc, Node loc)]
So a type similar to Dhall.Map
might be a better choice.
Encoding the following mapping
results in: