avoid using MonadFail in ParseDuration
There's no instance for Either String, so that makes it not as useful as it could be, so instead just return an Either String.
This commit is contained in:
parent
ad64079b44
commit
4c58433c48
7 changed files with 13 additions and 15 deletions
|
@ -103,8 +103,8 @@ parseExpire ps = do
|
|||
return (Just r, parsetime now t)
|
||||
parsetime _ "never" = Nothing
|
||||
parsetime now s = case parseDuration s of
|
||||
Nothing -> giveup $ "bad expire time: " ++ s
|
||||
Just d -> Just (now - durationToPOSIXTime d)
|
||||
Right d -> Just (now - durationToPOSIXTime d)
|
||||
Left e -> giveup $ "bad expire time: " ++ e
|
||||
|
||||
parseActivity :: MonadFail m => String -> m Activity
|
||||
parseActivity s = case readish s of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue