Skip to content

determinism: Use a stable sort in WithHsDocIdentifiers binary instance

Matthew Pickering requested to merge wip/with-hs-doc-identifiers-determ into master

WithHsDocIdentifiers is defined as

 71 data WithHsDocIdentifiers a pass = WithHsDocIdentifiers
 72   { hsDocString      :: !a
 73   , hsDocIdentifiers :: ![Located (IdP pass)]
 74   }

This list of names is populated from rnHsDocIdentifiers, which calls lookupGRE, which calls lookupOccEnv_AllNameSpaces, which calls nonDetEltsUFM and returns the results in an order depending on uniques.

Sorting the list with a stable sort before returning the interface makes the output deterministic and follows the approach taken by other fields in Docs.

Fixes #26858 (closed)

Merge request reports

Loading