summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcEvidence.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2017-04-04 21:47:29 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-04 21:47:51 -0400
commit1831aed16d9883b2845fa6997e38b9ac3d72f191 (patch)
tree5f18307cfda76206dc74f15f0678039e667d2427 /compiler/typecheck/TcEvidence.hs
parent5315223683b64c665959781112f8206fb8230a54 (diff)
downloadhaskell-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.hs6
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