Closed 5outh closed 3 years ago
It just bit me that rowToStr
also is affected by this, subsequent calls to it are technically not guaranteed to have the same order...
I wish NamedRecord
was an OrderedMap instead. I order the keys when I pass them to namedRecord
...
I would accept an MR to use probably [https://hackage.haskell.org/package/ordered-containers] to solve this problem. The impact seems significant enough that it would be worth making a breaking change than to try to preserve the old behavior. I can't imagine anyone is relying on the current implementation to put the keys in alphabetical order because that's how Map stores them.
With the given input file:
Running this program:
outputs the following to
out.csv
:It would be nice to preserve the ordering as determined by the header, or at least have the option to do so.