Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to support MonadFail #34

Merged
merged 1 commit into from
Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion System/Console/Docopt/Public.hs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ isPresentM :: Monad m => Arguments -> Option -> m Bool
isPresentM args o = return $ isPresent args o

{-# DEPRECATED getFirstArg "Use 'getAllArgs' instead" #-}
getFirstArg :: Monad m => Arguments -> Option -> m String
getFirstArg :: MonadFail m => Arguments -> Option -> m String
getFirstArg args opt =
let failure = fail $ "no argument given: " ++ show opt
in case opt `M.lookup` args of
Expand Down
4 changes: 3 additions & 1 deletion System/Console/Docopt/QQ.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ docopt = QuasiQuoter { quoteExp = docoptExp
, quotePat = unsupported "Pattern"
, quoteType = unsupported "Type"
}
where unsupported = fail . (++ " context unsupported")
where unsupported :: String -> String -> Q a
unsupported qqType _ = do
fail $ (qqType ++ " context unsupported")

-- | Same as 'docopt', but parses the given file instead of a literal
-- string.
Expand Down
2 changes: 1 addition & 1 deletion docopt.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ library
System.Console.Docopt.OptParse
System.Console.Docopt.Public

build-depends: base >= 4.0 && < 5.0,
build-depends: base >= 4.9 && < 5.0,
parsec >= 3.1.0,
containers

Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# For advanced use and comprehensive documentation of the format, please see:
# http://docs.haskellstack.org/en/stable/yaml_configuration/

resolver: lts-7.4
resolver: lts-16.20

packages:
- '.'
Expand Down