Closed ocharles closed 5 years ago
I do like the sorted output because it's likely to diff better, but I wouldn't mind too much if it went away.
In https://github.com/dhall-lang/dhall-haskell/pull/1066 I changed Dhall.Map.sort
to completely remove the original key order. Operations like union
were changed to ignore the key order of one argument if the other one has Sorted
keys. You might have some operations where you combine a normalized record with a non-normalized one. In that case you'd now get sorted keys where previously the key order was based on the inputs.
If the new behaviour of the Map
operations is problematic for you, we can probably do something about it.
Let's go ahead and just bite this bullet. It's a little bit of pain now but it's not just churn, since it does improve the diffability.
For some reason, our generated Dhall files from Cabal files now have keys sorted alphabetically. There is a call to
sortExpr
that has always been there, so it's unclear why this has only just started being a problem.Should we drop the call to
sortExpr
?