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
|
||||
,nodesToReAdd = lsuc graph
|
||||
,defVal = Everything
|
||||
,userErrLabel = show
|
||||
,userErrLabel = ("for node at: " ++) . show . fmap getNodeMeta . lab graph
|
||||
}
|
||||
|
||||
getMeta :: Node -> Meta
|
||||
|
|
|
@ -141,7 +141,7 @@ findReachDef graph startNode
|
|||
,nodesToProcess = lpre graph
|
||||
,nodesToReAdd = lsuc graph
|
||||
,defVal = Map.empty
|
||||
,userErrLabel = show
|
||||
,userErrLabel = ("for node at: " ++) . show . fmap getNodeMeta . lab graph
|
||||
}
|
||||
|
||||
readInNode' :: Node -> Var -> a -> Bool
|
||||
|
|
|
@ -129,9 +129,10 @@ flowAlgorithm funcs nodes (startNode, startVal)
|
|||
-- Pick the next node from the list and remove it:
|
||||
= do let (node, workList') = Set.deleteFindMin workList
|
||||
-- Process that node:
|
||||
total <- foldWithEither (iterateNode vals) (Left $ show workList
|
||||
++ userErrLabel
|
||||
funcs node) (nodesToProcess funcs node)
|
||||
total <- foldWithEither (iterateNode vals) (Left $
|
||||
"Nodes still to process: " ++ show workList
|
||||
++ " " ++ userErrLabel funcs node)
|
||||
(nodesToProcess funcs node)
|
||||
nodeVal <- Map.lookup node vals
|
||||
if total /= nodeVal
|
||||
-- If the value has changed, that will cascade to affect all
|
||||
|
|
Loading…
Reference in New Issue
Block a user