Gabriel439 Sort fields/alternatives when β-normalizing records/unions (#223)
Fixes dhall-lang/dhall-haskell#548

Previously the standard required that record and union comparisons were
insensitive to field order, but that meant that implementations could
potentially preserve field order even when serializing them.  Doing so
could lead to two different semantic integrity checks for records that
where semantically equivalent but with different field order.

A simpler approach is to not specify at all that records are order-insensitive.
Instead, specify that β-normalization sorts fields.  This has the nice
property that equivalence checks are still order-insensitive (since
equivalence checking β-normalizes both arguments) and that semantic
integrity checks are order-insensitive (since a semantic integrity check
β-normalizes the expression).
Latest commit 33b587e Aug 28, 2018