Fixed some uses of Map.lookup that used the old system of it working with any monad (in GHC 6.10, it's always Maybe)

This commit is contained in:
Neil Brown 2008-11-28 11:38:06 +00:00
parent ee62c604fc
commit b48129d4e5
2 changed files with 6 additions and 2 deletions

View File

@ -151,7 +151,9 @@ flowAlgorithm funcs nodes (startNode, startVal)
"Nodes still to process: " ++ show workList
++ " " ++ userErrLabel funcs node)
(filtNodes $ nodesToProcess funcs node)
nodeVal <- Map.lookup node vals
nodeVal <- case Map.lookup node vals of
Nothing -> throwError "Could not find node during flowAlgorithm"
Just x -> return x
if total /= nodeVal
-- If the value has changed, that will cascade to affect all
-- its dependents, so add all

View File

@ -380,7 +380,9 @@ pullUp pullUpArraysInsideRecords = pass "Pull up definitions"
ets <- sequence [astTypeOf e | e <- es']
ps <- get
rts <- Map.lookup (A.nameName n) (csFunctionReturns ps)
rts <- case Map.lookup (A.nameName n) (csFunctionReturns ps) of
Nothing -> dieP m "Could not find function returns"
Just x -> return x
specs <- sequence [makeNonceVariable "return_actual" m t A.Original | t <- rts]
sequence_ [addPulled $ (m, Left spec) | spec <- specs]