diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2017-04-04 21:47:29 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-04 21:47:51 -0400 |
commit | 1831aed16d9883b2845fa6997e38b9ac3d72f191 (patch) | |
tree | 5f18307cfda76206dc74f15f0678039e667d2427 /compiler/typecheck/TcEvidence.hs | |
parent | 5315223683b64c665959781112f8206fb8230a54 (diff) | |
download | haskell-1831aed16d9883b2845fa6997e38b9ac3d72f191.tar.gz |
Replace Digraph's Node type synonym with a data type
This refactoring makes it more obvious when we are constructing
a Node for the digraph rather than a less useful 3-tuple.
Reviewers: austin, goldfire, bgamari, simonmar, dfeuer
Reviewed By: dfeuer
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3414
Diffstat (limited to 'compiler/typecheck/TcEvidence.hs')
-rw-r--r-- | compiler/typecheck/TcEvidence.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/typecheck/TcEvidence.hs b/compiler/typecheck/TcEvidence.hs index 006b01ca92..eb809ab013 100644 --- a/compiler/typecheck/TcEvidence.hs +++ b/compiler/typecheck/TcEvidence.hs @@ -803,12 +803,12 @@ evVarsOfTerms = mapUnionVarSet evVarsOfTerm sccEvBinds :: Bag EvBind -> [SCC EvBind] sccEvBinds bs = stronglyConnCompFromEdgedVerticesUniq edges where - edges :: [(EvBind, EvVar, [EvVar])] + edges :: [ Node EvVar EvBind ] edges = foldrBag ((:) . mk_node) [] bs - mk_node :: EvBind -> (EvBind, EvVar, [EvVar]) + mk_node :: EvBind -> Node EvVar EvBind mk_node b@(EvBind { eb_lhs = var, eb_rhs = term }) - = (b, var, nonDetEltsUniqSet (evVarsOfTerm term `unionVarSet` + = DigraphNode b var (nonDetEltsUniqSet (evVarsOfTerm term `unionVarSet` coVarsOfType (varType var))) -- It's OK to use nonDetEltsUniqSet here as stronglyConnCompFromEdgedVertices -- is still deterministic even if the edges are in nondeterministic order |