`Ord Literal` instance is non-deterministic
Ord Literal instance is non-deterministic, because it uses
uniqCompareFS to compare a
LitLabel in the
cmpLit function. That non-determinism propagates into the
CoreMap implementation, which I'm pretty certain people expect to behave deterministically.
Given how rare FFI calls are, I suspect that this non-determinism is mostly of theoretical interest. Nevertheless I at least wanted to document it.
FastString field of
LexicalFastString and use its
Ord instance. Alternatively, replace
Lexical comparison is O(n), but given the rarity of
LitLabel it shouldn't matter much. Also we compare the
LitString lexically already, which I expect to occur much more often.