summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcBinds.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-06-14 03:28:30 -0700
committerBartosz Nitka <niteria@gmail.com>2016-06-23 07:53:12 -0700
commit35d1564cea2e611a4fecf24f09eff83f8a55af1c (patch)
tree5d46f89500052d356bf68e2befd6bf854550193a /compiler/typecheck/TcBinds.hs
parent7fc20b02b20c97209b97f0e36d34a4ef40f537a4 (diff)
downloadhaskell-35d1564cea2e611a4fecf24f09eff83f8a55af1c.tar.gz
Provide Uniquable version of SCC
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: ./validate 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
Diffstat (limited to 'compiler/typecheck/TcBinds.hs')
-rw-r--r--compiler/typecheck/TcBinds.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs
index d23b9527c5..7c45ac7b59 100644
--- a/compiler/typecheck/TcBinds.hs
+++ b/compiler/typecheck/TcBinds.hs
@@ -441,7 +441,7 @@ tc_group top_lvl sig_fn prag_fn (Recursive, binds) closed thing_inside
isPatSyn _ = False
sccs :: [SCC (LHsBind Name)]
- sccs = stronglyConnCompFromEdgedVertices (mkEdges sig_fn binds)
+ sccs = stronglyConnCompFromEdgedVerticesUniq (mkEdges sig_fn binds)
go :: [SCC (LHsBind Name)] -> TcM (LHsBinds TcId, thing)
go (scc:sccs) = do { (binds1, ids1) <- tc_scc scc