logoalt Hacker News

JadeNB11/07/20240 repliesview on HN

(The initial version of this comment missed the point of your question; sorry.) The author says:

> We also store pairs as the pair type (Key-Value), instead of two separate values. This makes easy to serialize a dictionary into a list of pairs, which are sortable using the builtin keysort/2.

`Key, Value` is two values, not one. I suspect something like `kv(Key, Value)` would work as well.

By the way, I disagree that the refactored version doesn't cut; `-> ;` is syntactic sugar over a cut.