\&V:      Safe-Inferred !"# ! !"# Safe-Inferred-5Type to wrap results from the pure parsing functions.The CLI was used with --help. The  contains the help message. "The CLI was used incorrectly. The & contains a list of error messages.ZIt can also happen that the data type you're trying to use isn't supported. See the  9https://github.com/zalora/getopt-generics#getopt-genericsREADME for details. /The CLI was used correctly and a value of type a! was successfully constructed.  $%&'()*+ $%&  $%&'()*+None !"3E  3s can be used to customize the command line parser. AddVersionFlag version adds a  --version flag.  AddOptionHelp fieldName helpText$ adds a help text for the option  fieldName.0UseForPositionalArguments fieldName argumentType! fills the field addressed by  fieldNamer with the positional arguments (i.e. arguments that don't correspond to a flag). The field has to have type [,]. argumentTypeG is used as the type of the positional arguments in the help output.RenameOptions fO renames all options with the given functions. In case the function returns Nothing! the original field name is used.Can be used together with .!RenameOption fieldName customName- renames the option generated through the  fieldName by  customName.AddShortOption fieldName c adds the - c1 as a short option for the field addressed by  fieldName.Derives Gs for all fields of the datatype that start with a unique character../01234 56789:;<=>?@A. 5789:;<=?@./01234  56789:;<=>?@ANone !"&()+-02346=HJKM 'Type class for all allowed field types.AIf you want to use custom field types you should implement an instance Option YourCustomType" containing implementations of  and # (the minimal complete definition).Here's an example: c {-# LANGUAGE DeriveDataTypeable #-} import Data.Typeable import System.Console.GetOpt.Generics data File = File FilePath deriving (Show, Typeable) instance Option File where argumentType Proxy = "custom-file-type" parseArgument f = Just (File f) main :: IO () main = simpleCLI $ \ file -> do print (file :: File)This would give you: ~ $ program some/file File "some/file" $ program --help program [OPTIONS] custom-file-type -h --help show help and exit4Name of the argument type, e.g. "bool" or "integer". Parses a , into an argument. Returns B on parse errors.C)This is meant to be an internal function.D)This is meant to be an internal function.E)This is meant to be an internal function.+Parses command line arguments (gotten from FW) and returns the parsed value. This function should be enough for simple use-cases.Throws the same exceptions as  simpleCLI.Here's an example: 6 {-# LANGUAGE DeriveGeneric #-} import GHC.Generics import System.Console.GetOpt.Generics -- All you have to do is to define a type and derive some instances: data Options = Options { port :: Int, daemonize :: Bool, config :: Maybe FilePath } deriving (Show, GHC.Generics.Generic) instance System.Console.GetOpt.Generics.Generic Options instance HasDatatypeInfo Options -- Then you can use `getArguments` to create a command-line argument parser: main :: IO () main = do options <- getArguments print (options :: Options)*And this is how the above program behaves:  $ program --port 8080 --config some/path Options {port = 8080, daemonize = False, config = Just "some/path"} $ program --port 8080 --daemonize Options {port = 8080, daemonize = True, config = Nothing} $ program --port foo cannot parse as INTEGER: foo $ program missing option: --port=INTEGER $ program --help program [OPTIONS] --port=INTEGER --daemonize --config=STRING (optional) -h --help show help and exitLike  but allows you to pass in  s.Pure variant of .Does not throw any exceptions.0CDEGHIJKLMNOPQRSTName of the program (e.g. from U).List of  /s to manually tweak the command line interface.3List of command line arguments to parse (e.g. from V).WXYZ[\]^_`abcdefghijklmno(CDEGHIJKLMNOPQRSTWXYZ[\]^_`abcdefg!CDEGLKJIHMONPQRTSWXYZ[\]^_`abcdefghijklmnoNone!"&(0234=JKMh converts an IO operation into a program with a proper CLI. Retrieves command line arguments through F. maino (the given IO operation) can have arbitrarily many parameters provided all parameters have an instance for .#May throw the following exceptions: ExitFailure 1@ in case of invalid options. Error messages are written to stderr. ExitSuccess in case --help is given. ( ExitSuccesso behaves like a normal exception, except that -- if uncaught -- the process will exit with exit-code 0.) Help output is written to stdout.Example:  import System.Console.GetOpt.Generics main :: IO () main = simpleCLI myMain myMain :: String -> Int -> Bool -> IO () myMain s i b = print (s, i, b) Using the above program in bash:  $ program foo 42 true ("foo",42,True) $ program foo 42 bar cannot parse as BOOL: bar $ program --help program [OPTIONS] STRING INTEGER BOOL -h --help show help and exitpqrspqpqrsNone    t        !"#$%&'()**+,-./012345678 9:;<=>>?@ABCDEFGHIJKLMNOP QRSTU VWXYZ[\]^_`aabcd Ve Vfghijklmnopqrstuvwxyz{|}~getopt-generics-0.10System.Console.GetOpt.Generics*System.Console.GetOpt.Generics.FieldString%System.Console.GetOpt.Generics.Result'System.Console.GetOpt.Generics.Modifier Data.List stripPrefix+System.Console.GetOpt.Generics.GetArguments%System.Console.GetOpt.Generics.Simplebase Data.ProxyProxygenerics-sop-0.1.1.2Generics.SOP.UniverseCodeGenericHasDatatypeInfoGenerics.SOP.ConstraintAll2Generics.SOP.SingSingIResult OutputAndExitErrorsSuccessModifierAddVersionFlag AddOptionHelpUseForPositionalArguments RenameOptions RenameOptionAddShortOptionderiveShortOptionsOption argumentType parseArgument getArgumentsmodifiedGetArgumentsparseArguments SimpleCLI ArgumentTypes simpleCLI FieldString normalized mkFieldStringmatchesrenameUnnormalized normalize isAllowedCharerrors outputAndExit handleResultaddNewlineIfMissingremoveTrailingNewlinestripTrailingSpaces $fMonadResult$fApplicativeResultGHC.BaseStringghc-prim GHC.TypesChar Modifiers _shortOptions _renamingpositionalArgumentsField helpTextsversion mkModifierslookupMatchingmkShortOptions mkLongOptionhasPositionalArgumentsFieldisPositionalArgumentsFieldgetPositionalArgumentType getHelpText getVersionflagsmkShortModifiers insertWithinsert Data.MaybeNothing _toOption _emptyOption _accumulateSystem.EnvironmentwithArgs FieldStatePositionalArgumentPositionalArguments FieldSuccess FieldErrorsUnsetOutputInfoFlag VersionFlagHelpFlag OptDescrEFieldSelector NoSelector getProgNamegetArgs processFields mkOptDescrs mkOptDescr toOptDescrmkInitialFieldStates outputInfopositionalArgumentHelpfillInPositionalArguments collectResultproject impossible uninhabitedtoProxyparseArgumentEitherparseAsFieldStatecombine readNumber$fOptionDouble $fOptionFloat$fOptionInteger $fOptionInt $fOption[] $fOptionBool $fOptionMaybe $fOption[]0_initialFieldStates_run$fSimpleCLI(->) $fSimpleCLIIO