-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple command line interface arguments parser -- -- Simple command line interface arguments parser @package optima @version 0.2 module Optima -- | Execute the parameters parser in IO, throwing an exception if anything -- goes wrong. params :: Text -> Params a -> IO a -- | Parameters product parser. Should be used for composition of all -- application parameters. data Params a -- | Lift a single parameter parser. param :: Maybe Char -> Text -> Param a -> Params a -- | Lift a parameter group parser. -- -- The param group cannot use short names, only long names. paramGroup :: Text -> ParamGroup a -> Params a -- | Parameter group, which gets identified by prefixing the names. -- -- Should be used to define parameters, which only make sense in -- combination. E.g., a server config can be defined by providing port -- and host together. data ParamGroup a -- | Lift a param parser into parameter group. member :: Text -> Param a -> ParamGroup a -- | Unite a group by a shared prefix. memberGroup :: Text -> ParamGroup a -> ParamGroup a -- | Parameter parser. -- -- Includes the description of the parameter. data Param a -- | Create a single parameter parser from a value parser and meta -- information. value :: Text -> Default a -> ValueFormat a -> Value a -> Param a -- | A parameter with no value. Fails if it's not present. Thus it can be -- composed using Alternative. flag :: Text -> Param () -- | A parameter with no value, the presence of which is interpreted as -- True. switch :: Text -> Param Bool -- | Parameter value parser. data Value a -- | Lift an Attoparsec parser into value parser. explicitlyParsed :: Parser a -> Value a -- | Lift an implicit lenient Attoparsec parser into value parser. implicitlyParsed :: LenientParser a => Value a -- | Default value with its textual representation. data Default a -- | Provide a default value with explicit textual representation. explicitlyRepresented :: a -> Text -> Default a -- | Provide a default value with textual representation formed using the -- implicit Show instance. showable :: Show a => a -> Default a -- | Provide no default value. defaultless :: Default a -- | Parameter description. data ValueFormat a -- | Derive value format specification from the Enum instance and explicit -- mapping of values to their representations. formattedByEnum :: (Bounded a, Enum a) => (a -> Text) -> ValueFormat a -- | Derive value format specification from the Enum and Show instances. formattedByEnumUsingShow :: (Bounded a, Enum a, Show a) => ValueFormat a -- | Avoid specifying the format. unformatted :: ValueFormat a instance GHC.Base.Functor Optima.Params instance GHC.Base.Applicative Optima.Params instance GHC.Base.Alternative Optima.Params instance GHC.Base.Functor Optima.ParamGroup instance GHC.Base.Functor Optima.Param instance GHC.Base.Functor Optima.Value instance GHC.Base.Applicative Optima.Value instance GHC.Base.Alternative Optima.Value instance GHC.Base.Monad Optima.Value instance GHC.Base.MonadPlus Optima.Value instance Control.Monad.Fail.MonadFail Optima.Value instance GHC.Base.Functor Optima.Default instance GHC.Base.Functor Optima.ValueFormat instance GHC.Base.Applicative Optima.ParamGroup instance GHC.Base.Alternative Optima.ParamGroup