diff options
author | Benjamin Barenblat <bbarenblat@gmail.com> | 2022-01-19 12:58:54 -0500 |
---|---|---|
committer | Benjamin Barenblat <bbarenblat@gmail.com> | 2022-01-19 13:31:02 -0500 |
commit | 44df82dcbf72d01d2bbb6c0afacff329ca749854 (patch) | |
tree | 2619d3890a9e7e532f0ad19fd5fb4e6579bd0db7 /Assistant/Alert | |
parent | 0ded71e9a53b1482019aedaa194e913d3a021c8d (diff) |
Eliminate Data.Map.insertWith'
containers-0.6 removed insertWith' in favor of the Data.Map.Strict API.
Switch to the new API where appropriate.
Diffstat (limited to 'Assistant/Alert')
-rw-r--r-- | Assistant/Alert/Utility.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Assistant/Alert/Utility.hs b/Assistant/Alert/Utility.hs index 5a6c73b85..4618633cc 100644 --- a/Assistant/Alert/Utility.hs +++ b/Assistant/Alert/Utility.hs @@ -1,6 +1,7 @@ {- git-annex assistant alert utilities - - Copyright 2012, 2013 Joey Hess <id@joeyh.name> + - Copyright 2022 Benjamin Barenblat <bbarenblat@gmail.com> - - Licensed under the GNU GPL version 3 or higher. -} @@ -13,7 +14,7 @@ import Utility.Tense import qualified Data.Text as T import Data.Text (Text) -import qualified Data.Map as M +import qualified Data.Map.Strict as M {- This is as many alerts as it makes sense to display at a time. - A display might be smaller, or larger, the point is to not overwhelm the @@ -121,8 +122,7 @@ mergeAlert i al m = maybe updatePrune updateCombine (alertCombiner al) pruneold l = let (f, rest) = partition (\(_, a) -> isFiller a) l in drop bloat f ++ rest - updatePrune = pruneBloat $ M.filterWithKey pruneSame $ - M.insertWith' const i al m + updatePrune = pruneBloat $ M.filterWithKey pruneSame $ M.insert i al m updateCombine combiner = let combined = M.mapMaybe (combiner al) m in if M.null combined |