-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Helper functions for optparse-applicative. -- -- The optparse-applicative package, as well as optparse-simple, has some -- undesirable behavior by default, and is quite verbose. This package -- exists to work around those two. -- -- For instance: -- -- -- -- For more specific documentation, see the module documentation for -- Options.Applicative.Helper. @package optparse-helper @version 0.2.1.0 -- | Helper functions to complement Options.Applicative -- -- To use, do something like this: -- --
--   module Main where
--   
--   import Options.Applicative
--   import Options.Applicative.Helper
--   
--   data ParserResult = Result1
--                     | Result2
--                     | Result3
--     deriving (Show)
--   
--   main :: IO ()
--   main =
--     do myResult <- helperExecParser myParser (fpDesc "Demonstration")
--        doSomethingWith myResult
--   
--   myParser :: Parser ParserResult
--   myParser =
--     subconcat [ command "result1"
--                         (infoHelper (pure Result1)
--                                     (fpDesc "Result1"))
--               , command "result2"
--                         (infoHelper (pure Result2)
--                                     (fpDesc "Result2"))
--               , command "result3"
--                         (infoHelper (pure Result3)
--                                     (fpDesc "Result3"))
--               ]
--   
--   doSomethingWith :: ParserResult -> IO ()
--   doSomethingWith = print
--   
module Options.Applicative.Helper -- | Wrapper around info and helper -- --
--   info (helper <*> a) ...
--   
-- -- Instead, it's just -- --
--   infoHelper a ...
--   
infoHelper :: Parser a -> InfoMod a -> ParserInfo a -- | Sort of like mconcat for Alternatives -- -- Instead of -- --
--   foo <|> bar <|> baz <|> quux <|> ...
--   
-- -- Now, it's just -- --
--   altconcat [ foo
--             , bar
--             , baz
--             , quux
--             ...
--             ]
--   
altconcat :: Alternative f => [f a] -> f a -- |
--   altconcat . fmap subparser
--   
-- -- Instead of -- --
--   subparser (command "foo" ...)
--     <|> subparser (command "bar" ...)
--     <|> subparser (command "baz" ...)
--     ...
--   
-- -- Instead it's -- --
--   subconcat [ command "foo" ...
--             , command "bar" ...
--             , command "baz" ...
--             ...
--             ]
--   
subconcat :: [Mod CommandFields a] -> Parser a -- |
--   mappend fullDesc . progDesc
--   
-- --
--   mconcat [ fullDesc
--           , progDesc "whatever"
--           ...
--           ]
--   
-- -- Now, it's just -- --
--   mconcat [ fpDesc "whatever"
--           ...
--           ]
--   
fpDesc :: String -> InfoMod a -- | Preferences that I like. Using these preferences, your app will -- -- -- -- Note that you should use this in combination with infoHelper -- for maximum helpfulness. -- --
--   prefs helperPrefsMod
--   
helperPrefs :: ParserPrefs -- | The PrefsMod for helperPrefs so that you can add on your -- own preferences. -- --
--   mappend disambiguate showHelpOnError
--   
helperPrefsMod :: PrefsMod -- | Wrapper around customExecParser, helperPrefs, and -- infoHelper -- --
--   helperExecParser a b = customExecParser helperPrefs (infoHelper a b)
--   
helperExecParser :: Parser a -> InfoMod a -> IO a