Fix build with ghc-8.8.x.

The 'fail' method has been moved to the 'MonadFail' class. I made the changes
so that the code still compiles with previous versions of 'base' that don't
have the new MonadFail class exported by Prelude yet.
This commit is contained in:
Peter Simons 2020-02-28 11:56:48 +01:00 committed by Joey Hess
parent c257951b85
commit 73cf523a4b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 13 additions and 9 deletions

View file

@ -9,6 +9,7 @@
module CmdLine.GitAnnex.Options where
import Control.Monad.Fail as Fail ( MonadFail(..) )
import Options.Applicative
import qualified Data.Map as M
@ -215,8 +216,8 @@ parseAllOption = flag' WantAllKeys
<> help "operate on all versions of all files"
)
parseKey :: Monad m => String -> m Key
parseKey = maybe (fail "invalid key") return . deserializeKey
parseKey :: MonadFail m => String -> m Key
parseKey = maybe (Fail.fail "invalid key") return . deserializeKey
-- Options to match properties of annexed files.
annexedMatchingOptions :: [GlobalOption]