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:
parent
c257951b85
commit
73cf523a4b
4 changed files with 13 additions and 9 deletions
|
@ -17,6 +17,7 @@ import Annex.VectorClock
|
|||
import qualified Remote
|
||||
import Utility.HumanTime
|
||||
|
||||
import Control.Monad.Fail as Fail ( MonadFail(..) )
|
||||
import Data.Time.Clock.POSIX
|
||||
import qualified Data.Map as M
|
||||
|
||||
|
@ -105,9 +106,9 @@ parseExpire ps = do
|
|||
Nothing -> giveup $ "bad expire time: " ++ s
|
||||
Just d -> Just (now - durationToPOSIXTime d)
|
||||
|
||||
parseActivity :: Monad m => String -> m Activity
|
||||
parseActivity :: MonadFail m => String -> m Activity
|
||||
parseActivity s = case readish s of
|
||||
Nothing -> fail $ "Unknown activity. Choose from: " ++
|
||||
Nothing -> Fail.fail $ "Unknown activity. Choose from: " ++
|
||||
unwords (map show [minBound..maxBound :: Activity])
|
||||
Just v -> return v
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue