diff options
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,6 +1,7 @@ {- git-annex monad - - Copyright 2010-2018 Joey Hess <id@joeyh.name> + - Copyright 2022 Benjamin Barenblat <bbarenblat@gmail.com> - - 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 () |