Changed the uses of flowAlgorithm to make better use of userErrLabel to give better error messages
This commit is contained in:
parent
24b10deb33
commit
17255bb2b1
|
@ -181,7 +181,7 @@ checkInitVar m graph startNode
|
||||||
,nodesToProcess = lpre graph
|
,nodesToProcess = lpre graph
|
||||||
,nodesToReAdd = lsuc graph
|
,nodesToReAdd = lsuc graph
|
||||||
,defVal = Everything
|
,defVal = Everything
|
||||||
,userErrLabel = show
|
,userErrLabel = ("for node at: " ++) . show . fmap getNodeMeta . lab graph
|
||||||
}
|
}
|
||||||
|
|
||||||
getMeta :: Node -> Meta
|
getMeta :: Node -> Meta
|
||||||
|
|
|
@ -141,7 +141,7 @@ findReachDef graph startNode
|
||||||
,nodesToProcess = lpre graph
|
,nodesToProcess = lpre graph
|
||||||
,nodesToReAdd = lsuc graph
|
,nodesToReAdd = lsuc graph
|
||||||
,defVal = Map.empty
|
,defVal = Map.empty
|
||||||
,userErrLabel = show
|
,userErrLabel = ("for node at: " ++) . show . fmap getNodeMeta . lab graph
|
||||||
}
|
}
|
||||||
|
|
||||||
readInNode' :: Node -> Var -> a -> Bool
|
readInNode' :: Node -> Var -> a -> Bool
|
||||||
|
|
|
@ -129,9 +129,10 @@ flowAlgorithm funcs nodes (startNode, startVal)
|
||||||
-- Pick the next node from the list and remove it:
|
-- Pick the next node from the list and remove it:
|
||||||
= do let (node, workList') = Set.deleteFindMin workList
|
= do let (node, workList') = Set.deleteFindMin workList
|
||||||
-- Process that node:
|
-- Process that node:
|
||||||
total <- foldWithEither (iterateNode vals) (Left $ show workList
|
total <- foldWithEither (iterateNode vals) (Left $
|
||||||
++ userErrLabel
|
"Nodes still to process: " ++ show workList
|
||||||
funcs node) (nodesToProcess funcs node)
|
++ " " ++ userErrLabel funcs node)
|
||||||
|
(nodesToProcess funcs node)
|
||||||
nodeVal <- Map.lookup node vals
|
nodeVal <- Map.lookup node vals
|
||||||
if total /= nodeVal
|
if total /= nodeVal
|
||||||
-- If the value has changed, that will cascade to affect all
|
-- If the value has changed, that will cascade to affect all
|
||||||
|
|
Loading…
Reference in New Issue
Block a user