[Git][ghc/ghc][master] Remove unused accumulators in partition_errors
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Tue Oct 8 17:37:07 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
d5c2577f by Arnaud Spiwack at 2024-10-08T13:36:44-04:00
Remove unused accumulators in partition_errors
- - - - -
1 changed file:
- compiler/GHC/Tc/Errors.hs
Changes:
=====================================
compiler/GHC/Tc/Errors.hs
=====================================
@@ -580,22 +580,20 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics
tidy_errs = bagToList (mapBag (tidyDelayedError env) errs)
partition_errors :: [DelayedError] -> ([Hole], [Hole], [NotConcreteError], [(TcCoercion, CtLoc)])
- partition_errors = go [] [] [] []
- where
- go out_of_scope other_holes syn_eqs mult_co_errs []
- = (out_of_scope, other_holes, syn_eqs, mult_co_errs)
- go es1 es2 es3 es4 (err:errs)
- | (es1, es2, es3, es4) <- go es1 es2 es3 es4 errs
- = case err of
- DE_Hole hole
- | isOutOfScopeHole hole
- -> (hole : es1, es2, es3, es4)
- | otherwise
- -> (es1, hole : es2, es3, es4)
- DE_NotConcrete err
- -> (es1, es2, err : es3, es4)
- DE_Multiplicity mult_co loc
- -> (es1, es2, es3, (mult_co, loc):es4)
+ partition_errors []
+ = ([], [], [], [])
+ partition_errors (err:errs)
+ | (es1, es2, es3, es4) <- partition_errors errs
+ = case err of
+ DE_Hole hole
+ | isOutOfScopeHole hole
+ -> (hole : es1, es2, es3, es4)
+ | otherwise
+ -> (es1, hole : es2, es3, es4)
+ DE_NotConcrete err
+ -> (es1, es2, err : es3, es4)
+ DE_Multiplicity mult_co loc
+ -> (es1, es2, es3, (mult_co, loc):es4)
-- See Note [Suppressing confusing errors]
suppress :: ErrorItem -> Bool
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d5c2577f12a103dec3c88d2403f59de48269d9c3
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d5c2577f12a103dec3c88d2403f59de48269d9c3
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241008/3e5bef66/attachment-0001.html>
More information about the ghc-commits
mailing list