-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Declarative command line option parser -- @package optparse-declarative @version 0.3.0 -- | Declarative options parser module Options.Declarative -- | Command class class IsCmd c where getCmdHelp f = getCmdHelp $ f undefined getOptDescr f = getOptDescr $ f undefined getUsageHeader f = getUsageHeader $ f undefined getUsageFooter f = getUsageFooter $ f undefined -- | Command data Cmd (help :: Symbol) a -- | Output string when the verbosity level is greater than or equal to -- logLevel logStr :: Int -> String -> Cmd help () -- | Return the verbosity level ('--verbosity=n') getVerbosity :: Cmd help Int -- | Retrieve the logger function getLogger :: MonadIO m => Cmd a (Int -> String -> m ()) -- | Command line option class Option a where type family Value a :: * get :: Option a => a -> Value a -- | Named argument data Flag (shortNames :: Symbol) (longNames :: [Symbol]) (placeholder :: Symbol) (help :: Symbol) a -- | Unnamed argument data Arg (placeholder :: Symbol) a -- | Command line option's annotated types class ArgRead a where type family Unwrap a :: * type instance Unwrap a = a unwrap = id argRead s = readMaybe =<< s needArg _ = True unwrap :: ArgRead a => a -> Unwrap a argRead :: ArgRead a => Maybe String -> Maybe a needArg :: ArgRead a => Proxy a -> Bool -- | The argument which has defalut value data Def (defaultValue :: Symbol) a -- | Command group data Group Group :: String -> [SubCmd] -> Group groupHelp :: Group -> String groupCmds :: Group -> [SubCmd] -- | Sub command data SubCmd -- | Make a sub command subCmd :: IsCmd c => String -> c -> SubCmd -- | Run a command with specifying program name and version run :: IsCmd c => String -> Maybe String -> c -> IO () -- | Run a command run_ :: IsCmd c => c -> IO () instance Functor (Cmd help) instance Applicative (Cmd help) instance Monad (Cmd help) instance MonadIO (Cmd help) instance IsCmd Group instance KnownSymbol help => IsCmd (Cmd help ()) instance (KnownSymbol placeholder, IsCmd c) => IsCmd (Arg placeholder [String] -> c) instance (KnownSymbol placeholder, IsCmd c) => IsCmd (Arg placeholder String -> c) instance (KnownSymbol shortNames, KnownSymbols longNames, KnownSymbol placeholder, KnownSymbol help, ArgRead a, IsCmd c) => IsCmd (Flag shortNames longNames placeholder help a -> c) instance (KnownSymbol s, KnownSymbols ss) => KnownSymbols (s : ss) instance KnownSymbols '[] instance (KnownSymbol defaultValue, ArgRead a) => ArgRead (Def defaultValue a) instance ArgRead a => ArgRead (Maybe a) instance ArgRead Bool instance ArgRead String instance ArgRead Double instance ArgRead Integer instance ArgRead Int instance Option (Arg _a a) instance ArgRead a => Option (Flag _a _b _c _d a)