We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding the following mapping
encode [mapping ["a" .= (1 :: Int), "d" .= (2 :: Int), "c" .= (3 :: Int), "b" .= (4 :: Int)]]
results in:
a: 1 b: 4 c: 3 d: 2
The text was updated successfully, but these errors were encountered:
Is this a feature request?
Sorry, something went wrong.
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:
HsYAML/src/Data/YAML/Internal.hs
Lines 40 to 41 in be60400
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.
Dhall.Map
No branches or pull requests
Encoding the following mapping
results in:
The text was updated successfully, but these errors were encountered: