• niteria's avatar
    Provide Uniquable version of SCC · 35d1564c
    niteria authored
    We want to remove the `Ord Unique` instance because there's
    no way to implement it in deterministic way and it's too
    easy to use by accident.
    We sometimes compute SCC for datatypes whose Ord instance
    is implemented in terms of Unique. The Ord constraint on
    SCC is just an artifact of some internal data structures.
    We can have an alternative implementation with a data
    structure that uses Uniquable instead.
    This does exactly that and I'm pleased that I didn't have
    to introduce any duplication to do that.
    Test Plan:
    I looked at performance tests and it's a tiny bit better.
    Reviewers: bgamari, simonmar, ezyang, austin, goldfire
    Subscribers: thomie
    Differential Revision: https://phabricator.haskell.org/D2359
    GHC Trac Issues: #4012
RnSource.hs 92.2 KB