From 44df82dcbf72d01d2bbb6c0afacff329ca749854 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 19 Jan 2022 12:58:54 -0500 Subject: Eliminate Data.Map.insertWith' containers-0.6 removed insertWith' in favor of the Data.Map.Strict API. Switch to the new API where appropriate. --- Annex.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Annex.hs') diff --git a/Annex.hs b/Annex.hs index 7b4bb706c..54f71aee9 100644 --- a/Annex.hs +++ b/Annex.hs @@ -1,6 +1,7 @@ {- git-annex monad - - Copyright 2010-2018 Joey Hess + - Copyright 2022 Benjamin Barenblat - - Licensed under the GNU GPL version 3 or higher. -} @@ -73,7 +74,7 @@ import "mtl" Control.Monad.Reader import Control.Concurrent import Control.Concurrent.Async import Control.Concurrent.STM -import qualified Data.Map as M +import qualified Data.Map.Strict as M import qualified Data.Set as S {- git-annex's monad is a ReaderT around an AnnexState stored in a MVar. @@ -259,18 +260,16 @@ withState modifier = do {- Sets a flag to True -} setFlag :: String -> Annex () -setFlag flag = changeState $ \s -> - s { flags = M.insertWith' const flag True $ flags s } +setFlag flag = changeState $ \s -> s { flags = M.insert flag True $ flags s } {- Sets a field to a value -} setField :: String -> String -> Annex () setField field value = changeState $ \s -> - s { fields = M.insertWith' const field value $ fields s } + s { fields = M.insert field value $ fields s } {- Adds a cleanup action to perform. -} addCleanup :: CleanupAction -> Annex () -> Annex () -addCleanup k a = changeState $ \s -> - s { cleanup = M.insertWith' const k a $ cleanup s } +addCleanup k a = changeState $ \s -> s { cleanup = M.insert k a $ cleanup s } {- Sets the type of output to emit. -} setOutput :: OutputType -> Annex () -- cgit v1.2.3