Convert `Map`s to JSON objects
There’s no place in hpack where mapName or mapValue can be used as object keys inside a list, so it’s safe to convert those instances to JSON objects, rather than a literal translation to an array of objects.
This is especially helpful when trying to typecheck hpack-dhall values, because while writing tests.foo = {=} is perfectly fine, it has a different type than tests.bar = {=}. However, tests = toMap { foo = {=} } and tests = toMap { bar = {=} } have the same type.
After this change, the two variants above (tests.foo and tests = toMap { foo … }) convert to the same JSON.
Also after this, I’ve been able to write consistent types for all of hpack-dhall, which has allowed me to define Dhall schemas and abstract a few other things in my package.dhall files, like autogenerating the license-file list
This should probably add a golden test or two.