-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Simple interface to optparse-applicative
--   
--   Please see the README at
--   <a>https://www.stackage.org/package/optparse-simple</a>
@package optparse-simple
@version 0.1.1.4


-- | Simple interface to program arguments.
--   
--   Typical usage with no commands:
--   
--   <pre>
--   do (opts,()) &lt;-
--        simpleOptions "ver"
--                      "header"
--                      "desc"
--                      (flag () () (long "some-flag"))
--                      empty
--      doThings opts
--   </pre>
--   
--   Typical usage with commands:
--   
--   <pre>
--   do (opts,runCmd) &lt;-
--        simpleOptions "ver"
--                      "header"
--                      "desc"
--                      (pure ()) $
--        do addCommand "delete"
--                      "Delete the thing"
--                      (const deleteTheThing)
--                      (pure ())
--           addCommand "create"
--                      "Create a thing"
--                      createAThing
--                      (strOption (long "hello"))
--      runCmd
--   </pre>
module Options.Applicative.Simple

-- | Generate and execute a simple options parser.
simpleOptions :: String -> String -> String -> Parser a -> ExceptT b (Writer (Mod CommandFields b)) () -> IO (a, b)

-- | Generate a simple options parser.
--   
--   Most of the time you should use <a>simpleOptions</a> instead, but
--   <a>simpleParser</a> can be used for sub-commands that need common
--   options. For example:
--   
--   <pre>
--   addCommand "thing"
--              "Subcommands that operate on things"
--              (\(opts,runSubCmd) -&gt; runSubCmd opts)
--              (simpleParser (flag () () (long "some-flag")) $
--               do addCommand "delete"
--                             "Delete the thing"
--                             (const deleteTheThing)
--                             (pure ())
--                  addCommand "create"
--                             "Create a thing"
--                             createAThing
--                             (strOption (long "hello")))
--   </pre>
simpleParser :: Parser a -> ExceptT b (Writer (Mod CommandFields b)) () -> Parser (a, b)

-- | Generate a string like <tt>Version 1.2, Git revision 1234</tt>.
--   
--   <tt>$(simpleVersion …)</tt> <tt>::</tt> <a>String</a>
simpleVersion :: Version -> Q Exp

-- | Add a command to the options dispatcher.
addCommand :: String -> String -> (a -> b) -> Parser a -> ExceptT b (Writer (Mod CommandFields b)) ()

-- | Add a command that takes sub-commands to the options dispatcher.
--   
--   Example:
--   
--   <pre>
--   addSubCommands "thing"
--                  "Subcommands that operate on things"
--                  (do addCommand "delete"
--                                 "Delete the thing"
--                                 (const deleteTheThing)
--                                 (pure ())
--                      addCommand "create"
--                                 "Create a thing"
--                                 createAThing
--                                 (strOption (long "hello")))
--   </pre>
--   
--   If there are common options between all the sub-commands, use
--   <a>addCommand</a> in combination with <a>simpleParser</a> instead of
--   <a>addSubCommands</a>.
addSubCommands :: String -> String -> ExceptT b (Writer (Mod CommandFields b)) () -> ExceptT b (Writer (Mod CommandFields b)) ()
class Functor f => Applicative (f :: Type -> Type)
pure :: Applicative f => a -> f a
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
(*>) :: Applicative f => f a -> f b -> f b
(<*) :: Applicative f => f a -> f b -> f a
data Parser a
data Mod (f :: Type -> Type) a
data CommandFields a
execParserPure :: ParserPrefs -> ParserInfo a -> [String] -> ParserResult a
prefs :: PrefsMod -> ParserPrefs
idm :: Monoid m => m
data ParserResult a
Success :: a -> ParserResult a
Failure :: ParserFailure ParserHelp -> ParserResult a
CompletionInvoked :: CompletionResult -> ParserResult a
execParser :: ParserInfo a -> IO a
handleParseResult :: ParserResult a -> IO a
info :: Parser a -> InfoMod a -> ParserInfo a
fullDesc :: InfoMod a
header :: String -> InfoMod a
progDesc :: String -> InfoMod a
infoOption :: String -> Mod OptionFields (a -> a) -> Parser (a -> a)
long :: forall (f :: Type -> Type) a. HasName f => String -> Mod f a
help :: forall (f :: Type -> Type) a. String -> Mod f a
command :: String -> ParserInfo a -> Mod CommandFields a
(<$>) :: Functor f => (a -> b) -> f a -> f b
helper :: Parser (a -> a)
abortOption :: ParseError -> Mod OptionFields (a -> a) -> Parser (a -> a)
data ParseError
ErrorMsg :: String -> ParseError
InfoMsg :: String -> ParseError
ShowHelpText :: Maybe String -> ParseError
UnknownError :: ParseError
MissingError :: IsCmdStart -> SomeParser -> ParseError
ExpectsArgError :: String -> ParseError
UnexpectedError :: String -> SomeParser -> ParseError
subparser :: Mod CommandFields a -> Parser a
(<$) :: Functor f => a -> f b -> f a
mappend :: Monoid a => a -> a -> a
class Applicative f => Alternative (f :: Type -> Type)
empty :: Alternative f => f a
(<|>) :: Alternative f => f a -> f a -> f a
some :: Alternative f => f a -> f [a]
many :: Alternative f => f a -> f [a]
flag :: a -> a -> Mod FlagFields a -> Parser a
str :: IsString s => ReadM s
newtype Const a (b :: k)
Const :: a -> Const a (b :: k)
[getConst] :: Const a (b :: k) -> a
data InfoMod a
data PrefsMod
action :: forall (f :: Type -> Type) a. HasCompleter f => String -> Mod f a
argument :: ReadM a -> Mod ArgumentFields a -> Parser a
auto :: Read a => ReadM a
briefDesc :: InfoMod a
columns :: Int -> PrefsMod
commandGroup :: String -> Mod CommandFields a
completeWith :: forall (f :: Type -> Type) a. HasCompleter f => [String] -> Mod f a
completer :: forall (f :: Type -> Type) a. HasCompleter f => Completer -> Mod f a
defaultPrefs :: ParserPrefs
disabled :: ReadM a
disambiguate :: PrefsMod
eitherReader :: (String -> Either String a) -> ReadM a
failureCode :: Int -> InfoMod a
flag' :: a -> Mod FlagFields a -> Parser a
footer :: String -> InfoMod a
footerDoc :: Maybe Doc -> InfoMod a
forwardOptions :: InfoMod a
headerDoc :: Maybe Doc -> InfoMod a
helpDoc :: forall (f :: Type -> Type) a. Maybe Doc -> Mod f a
helpIndent :: Int -> PrefsMod
helpLongEquals :: PrefsMod
helpShowGlobals :: PrefsMod
hidden :: forall (f :: Type -> Type) a. Mod f a
maybeReader :: (String -> Maybe a) -> ReadM a
metavar :: forall (f :: Type -> Type) a. HasMetavar f => String -> Mod f a
multiSuffix :: String -> PrefsMod
noArgError :: ParseError -> Mod OptionFields a
noBacktrack :: PrefsMod
noIntersperse :: InfoMod a
option :: ReadM a -> Mod OptionFields a -> Parser a
progDescDoc :: Maybe Doc -> InfoMod a
short :: forall (f :: Type -> Type) a. HasName f => Char -> Mod f a
showDefault :: forall a (f :: Type -> Type). Show a => Mod f a
showDefaultWith :: forall a (f :: Type -> Type). (a -> String) -> Mod f a
showHelpOnEmpty :: PrefsMod
showHelpOnError :: PrefsMod
strArgument :: IsString s => Mod ArgumentFields s -> Parser s
strOption :: IsString s => Mod OptionFields s -> Parser s
style :: forall (f :: Type -> Type) a. (Doc -> Doc) -> Mod f a
subparserInline :: PrefsMod
switch :: Mod FlagFields Bool -> Parser Bool
value :: forall (f :: Type -> Type) a. HasValue f => a -> Mod f a
bashCompleter :: String -> Completer
listCompleter :: [String] -> Completer
listIOCompleter :: IO [String] -> Completer
data ArgumentFields a
data FlagFields a
class HasCompleter (f :: Type -> Type)
class HasMetavar (f :: Type -> Type)
class HasName (f :: Type -> Type)
class HasValue (f :: Type -> Type)
data OptionFields a
internal :: forall (f :: Type -> Type) a. Mod f a
customExecParser :: ParserPrefs -> ParserInfo a -> IO a
getParseResult :: ParserResult a -> Maybe a
hsubparser :: Mod CommandFields a -> Parser a
parserFailure :: ParserPrefs -> ParserInfo a -> ParseError -> [Context] -> ParserFailure ParserHelp
renderFailure :: ParserFailure ParserHelp -> String -> (String, ExitCode)
simpleVersioner :: String -> Parser (a -> a)
data ParserHelp
ParserHelp :: Chunk Doc -> Chunk Doc -> Chunk Doc -> Chunk Doc -> Chunk Doc -> Chunk Doc -> Chunk Doc -> Chunk Doc -> ParserHelp
[helpError] :: ParserHelp -> Chunk Doc
[helpSuggestions] :: ParserHelp -> Chunk Doc
[helpHeader] :: ParserHelp -> Chunk Doc
[helpUsage] :: ParserHelp -> Chunk Doc
[helpDescription] :: ParserHelp -> Chunk Doc
[helpBody] :: ParserHelp -> Chunk Doc
[helpGlobals] :: ParserHelp -> Chunk Doc
[helpFooter] :: ParserHelp -> Chunk Doc
data Completer
newtype CompletionResult
CompletionResult :: (String -> IO String) -> CompletionResult
[execCompletion] :: CompletionResult -> String -> IO String
newtype ParserFailure h
ParserFailure :: (String -> (h, ExitCode, Int)) -> ParserFailure h
[execFailure] :: ParserFailure h -> String -> (h, ExitCode, Int)
data ParserInfo a
ParserInfo :: Parser a -> Bool -> Chunk Doc -> Chunk Doc -> Chunk Doc -> Int -> ArgPolicy -> ParserInfo a
[infoParser] :: ParserInfo a -> Parser a
[infoFullDesc] :: ParserInfo a -> Bool
[infoProgDesc] :: ParserInfo a -> Chunk Doc
[infoHeader] :: ParserInfo a -> Chunk Doc
[infoFooter] :: ParserInfo a -> Chunk Doc
[infoFailureCode] :: ParserInfo a -> Int
[infoPolicy] :: ParserInfo a -> ArgPolicy
data ParserPrefs
ParserPrefs :: String -> Bool -> Bool -> Bool -> Backtracking -> Int -> Bool -> Bool -> Int -> ParserPrefs
[prefMultiSuffix] :: ParserPrefs -> String
[prefDisambiguate] :: ParserPrefs -> Bool
[prefShowHelpOnError] :: ParserPrefs -> Bool
[prefShowHelpOnEmpty] :: ParserPrefs -> Bool
[prefBacktrack] :: ParserPrefs -> Backtracking
[prefColumns] :: ParserPrefs -> Int
[prefHelpLongEquals] :: ParserPrefs -> Bool
[prefHelpShowGlobal] :: ParserPrefs -> Bool
[prefTabulateFill] :: ParserPrefs -> Int
data ReadM a
mkCompleter :: (String -> IO [String]) -> Completer
overFailure :: (ParserHelp -> ParserHelp) -> ParserResult a -> ParserResult a
readerAbort :: ParseError -> ReadM a
readerError :: String -> ReadM a
optional :: Alternative f => f a -> f (Maybe a)
(<**>) :: Applicative f => f a -> f (a -> b) -> f b
liftA :: Applicative f => (a -> b) -> f a -> f b
liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
asum :: (Foldable t, Alternative f) => t (f a) -> f a
newtype WrappedArrow (a :: Type -> Type -> Type) b c
WrapArrow :: a b c -> WrappedArrow (a :: Type -> Type -> Type) b c
[unwrapArrow] :: WrappedArrow (a :: Type -> Type -> Type) b c -> a b c
newtype WrappedMonad (m :: Type -> Type) a
WrapMonad :: m a -> WrappedMonad (m :: Type -> Type) a
[unwrapMonad] :: WrappedMonad (m :: Type -> Type) a -> m a
newtype ZipList a
ZipList :: [a] -> ZipList a
[getZipList] :: ZipList a -> [a]
