diff options
Diffstat (limited to 'Utility/HumanTime.hs')
-rw-r--r-- | Utility/HumanTime.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Utility/HumanTime.hs b/Utility/HumanTime.hs index fe7cf22a9..77d846d97 100644 --- a/Utility/HumanTime.hs +++ b/Utility/HumanTime.hs @@ -1,8 +1,9 @@ {- Time for humans. - - Copyright 2012-2013 Joey Hess <id@joeyh.name> + - Copyright 2022 Benjamin Barenblat <bbarenblat@gmail.com> - - - License: BSD-2-clause + - License: Apache-2.0 -} module Utility.HumanTime ( @@ -44,7 +45,7 @@ daysToDuration :: Integer -> Duration daysToDuration i = Duration $ i * dsecs {- Parses a human-input time duration, of the form "5h", "1m", "5h1m", etc -} -parseDuration :: Monad m => String -> m Duration +parseDuration :: MonadFail m => String -> m Duration parseDuration = maybe parsefail (return . Duration) . go 0 where go n [] = return n |