Skip to content

Commit

Permalink
Use errorWithoutStackTrace directly
Browse files Browse the repository at this point in the history
The MonadFail instance of ST was removed, see
haskell/core-libraries-committee#33
  • Loading branch information
FPtje committed Aug 5, 2023
1 parent 7686a3e commit 6cec92c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions uuagc/trunk/src/KennedyWarren.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ kennedyWarrenOrder opts wr ndis typesyns derivings = runST $ runExceptT $ do
trc <- lift $ graphIsTRC g
when (not trc) $ do
let msg = "Nonterminal graph " ++ show nont ++ " is not transitively closed!"
fail msg
errorWithoutStackTrace msg
-- Consistency check
cons <- lift $ graphCheckConsistency g
when (not cons) $ do
let msg = "Nonterminal graph " ++ show nont ++ " is not consistent!"
fail msg
errorWithoutStackTrace msg

-- Loop trough all productions
forM_ (ndimProds ndi) $ \prod -> do
Expand All @@ -125,13 +125,13 @@ kennedyWarrenOrder opts wr ndis typesyns derivings = runST $ runExceptT $ do
when (not trc') $ do
lift $ traceST $ "Production graph " ++ show pr ++ " of nonterminal "
++ show nont ++ " is not transitively closed!"
fail "Production graph is not transitively closed."
errorWithoutStackTrace "Production graph is not transitively closed."
-- Check consistency
consistent <- lift $ graphCheckConsistency g'
when (not consistent) $ do
let msg = "Production graph " ++ show pr ++ " of nonterminal "
++ show nont ++ " is not consistent!"
fail msg
errorWithoutStackTrace msg
-- reachable when everything is ok
lift $ do
-- Create non-transitive closed graph for efficiency
Expand Down

0 comments on commit 6cec92c

Please sign in to comment.