aboutsummaryrefslogtreecommitdiff
path: root/CmdLine
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbarenblat@gmail.com>2022-01-19 13:04:08 -0500
committerGravatar Benjamin Barenblat <bbarenblat@gmail.com>2022-01-19 13:31:03 -0500
commitc79473051a8e1647b14f351b72768b74301acc33 (patch)
treeeb25ad044ab8e8b924b9fea02af4a264c998536e /CmdLine
parent44df82dcbf72d01d2bbb6c0afacff329ca749854 (diff)
Deal with the MonadFail proposal
base-4.9 split MonadFail from Monad. Strengthen some type signatures to require MonadFail instead of just Monad, derive MonadFail in relevant places, and change a partial pattern match inside STM to one that explicitly calls error. (STM is not a MonadFail; the user must explicitly specify the desired semantics if a pattern match doesn’t work out. In this case, the failing branch of the pattern should never be reached, so crashing is fine.)
Diffstat (limited to 'CmdLine')
-rw-r--r--CmdLine/GitAnnex/Options.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index 143bb6498..2a6dc0ef9 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -1,6 +1,7 @@
{- git-annex command-line option parsing
-
- Copyright 2010-2018 Joey Hess <id@joeyh.name>
+ - Copyright 2022 Benjamin Barenblat <bbarenblat@gmail.com>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -182,7 +183,7 @@ parseAllOption = flag' WantAllKeys
<> help "operate on all versions of all files"
)
-parseKey :: Monad m => String -> m Key
+parseKey :: MonadFail m => String -> m Key
parseKey = maybe (fail "invalid key") return . file2key
-- Options to match properties of annexed files.