dhall-lang / dhall-to-cabal

Compile Dhall expressions to Cabal files
MIT License
100 stars 19 forks source link

Upgrade to Dhall 1.25 #179

Closed ocharles closed 5 years ago

ocharles commented 5 years ago

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?

quasicomputational commented 5 years ago

175 might be somehow relevant to working out what was going on before? Though that can't be the whole story, since CI was green for it; something particular to Dhall 1.25 must be happening.

I do like the sorted output because it's likely to diff better, but I wouldn't mind too much if it went away.

sjakobi commented 5 years ago

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.

quasicomputational commented 5 years ago

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.