aeson icon indicating copy to clipboard operation
aeson copied to clipboard

What does ordered-keymap actually do?

Open Ptival opened this issue 1 month ago • 1 comments

In some application, for some reasons, it would make my life much easier if I could get the keys in a JSON file in the order they appeared.

I found the ordered-keymap flag, which I thought would help, but looking at the implementaiton under it, it seems to use containers Data.Map? Does this actually care about key insertion order?

Ptival avatar Nov 21 '25 01:11 Ptival

ordered-keymap uses the Ord-based Data.Map as opposed to the Hashable-based HashMap. Neither care about insertion order AFAIK.

(EDIT: Insertion order does matter with unordered-containers' HashMap in the case of hash collisions of course.)

sjakobi avatar Nov 29 '25 00:11 sjakobi