optparse-applicative-0.18.1.0: Utilities and combinators for parsing command line options

Safe Haskell | Safe-Inferred
Language | Haskell98

Options.Applicative.Internal

# Documentation

data P a #

#### Instances

Instances details

Alternative P # |
Instance details Defined in Options.Applicative.Internal Methods empty :: P a # (<|>) :: P a -> P a -> P a # some :: P a -> P [a] # many :: P a -> P [a] #
Applicative P # |
Instance details Defined in Options.Applicative.Internal Methods pure :: a -> P a # (<*>) :: P (a -> b) -> P a -> P b # liftA2 :: (a -> b -> c) -> P a -> P b -> P c # (*>) :: P a -> P b -> P b # (<*) :: P a -> P b -> P a #
Functor P # |
Instance details Defined in Options.Applicative.Internal Methods fmap :: (a -> b) -> P a -> P b # (<$) :: a -> P b -> P a #
Monad P # |
Instance details Defined in Options.Applicative.Internal Methods (>>=) :: P a -> (a -> P b) -> P b # (>>) :: P a -> P b -> P b # return :: a -> P a #
MonadPlus P # |
Instance details Defined in Options.Applicative.Internal Methods mzero :: P a # mplus :: P a -> P a -> P a #
MonadP P # |
Instance details Defined in Options.Applicative.Internal Methods enterContext :: String -> ParserInfo a -> P () # exitContext :: P () # getPrefs :: P ParserPrefs # missingArgP :: ParseError -> Completer -> P a # errorP :: ParseError -> P a # exitP :: IsCmdStart -> ArgPolicy -> Parser b -> Maybe a -> P a #

class (Alternative m, MonadPlus m) => MonadP (m :: Type -> Type) where #

Methods

enterContext :: String -> ParserInfo a -> m () #

exitContext :: m () #

getPrefs :: m ParserPrefs #

missingArgP :: ParseError -> Completer -> m a #

errorP :: ParseError -> m a #

exitP :: IsCmdStart -> ArgPolicy -> Parser b -> Maybe a -> m a #

#### Instances

Instances details

MonadP Completion # |
Instance details Defined in Options.Applicative.Internal Methods enterContext :: String -> ParserInfo a -> Completion () # exitContext :: Completion () # getPrefs :: Completion ParserPrefs # missingArgP :: ParseError -> Completer -> Completion a # errorP :: ParseError -> Completion a # exitP :: IsCmdStart -> ArgPolicy -> Parser b -> Maybe a -> Completion a #
MonadP P # |
Instance details Defined in Options.Applicative.Internal Methods enterContext :: String -> ParserInfo a -> P () # exitContext :: P () # getPrefs :: P ParserPrefs # missingArgP :: ParseError -> Completer -> P a # errorP :: ParseError -> P a # exitP :: IsCmdStart -> ArgPolicy -> Parser b -> Maybe a -> P a #

data ParseError #

Constructors

ErrorMsg String |
InfoMsg String |
ShowHelpText (Maybe String) |
UnknownError |
MissingError IsCmdStart SomeParser |
ExpectsArgError String |
UnexpectedError String SomeParser |

#### Instances

Instances details

Monoid ParseError # |
Instance details Defined in Options.Applicative.Types Methods mempty :: ParseError # mappend :: ParseError -> ParseError -> ParseError # mconcat :: [ParseError] -> ParseError #
Semigroup ParseError # |
Instance details Defined in Options.Applicative.Types Methods (<>) :: ParseError -> ParseError -> ParseError # sconcat :: NonEmpty ParseError -> ParseError # stimes :: Integral b => b -> ParseError -> ParseError #

uncons :: [a] -> Maybe (a, [a]) #

hoistMaybe :: MonadPlus m => Maybe a -> m a #

hoistEither :: MonadP m => Either ParseError a -> m a #

runReadM :: MonadP m => ReadM a -> String -> m a #

withReadM :: (String -> String) -> ReadM a -> ReadM a #

runP :: P a -> ParserPrefs -> (Either ParseError a, [Context]) #

data Completion a #

#### Instances

Instances details

Alternative Completion # |
Instance details Defined in Options.Applicative.Internal Methods empty :: Completion a # (<|>) :: Completion a -> Completion a -> Completion a # some :: Completion a -> Completion [a] # many :: Completion a -> Completion [a] #
Applicative Completion # |
Instance details Defined in Options.Applicative.Internal Methods pure :: a -> Completion a # (<*>) :: Completion (a -> b) -> Completion a -> Completion b # liftA2 :: (a -> b -> c) -> Completion a -> Completion b -> Completion c # (*>) :: Completion a -> Completion b -> Completion b # (<*) :: Completion a -> Completion b -> Completion a #
Functor Completion # |
Instance details Defined in Options.Applicative.Internal Methods fmap :: (a -> b) -> Completion a -> Completion b # (<$) :: a -> Completion b -> Completion a #
Monad Completion # |
Instance details Defined in Options.Applicative.Internal Methods (>>=) :: Completion a -> (a -> Completion b) -> Completion b # (>>) :: Completion a -> Completion b -> Completion b # return :: a -> Completion a #
MonadPlus Completion # |
Instance details Defined in Options.Applicative.Internal Methods mzero :: Completion a # mplus :: Completion a -> Completion a -> Completion a #
MonadP Completion # |
Instance details Defined in Options.Applicative.Internal Methods enterContext :: String -> ParserInfo a -> Completion () # exitContext :: Completion () # getPrefs :: Completion ParserPrefs # missingArgP :: ParseError -> Completer -> Completion a # errorP :: ParseError -> Completion a # exitP :: IsCmdStart -> ArgPolicy -> Parser b -> Maybe a -> Completion a #

runCompletion :: Completion r -> ParserPrefs -> Maybe (Either (SomeParser, ArgPolicy) Completer) #

contextNames :: [Context] -> [String] #

data ListT (m :: Type -> Type) a #

#### Instances

Instances details

MonadTrans ListT # |
Instance details Defined in Options.Applicative.Internal Methods lift :: Monad m => m a -> ListT m a #
Monad m => Alternative (ListT m) # |
Instance details Defined in Options.Applicative.Internal Methods empty :: ListT m a # (<|>) :: ListT m a -> ListT m a -> ListT m a # some :: ListT m a -> ListT m [a] # many :: ListT m a -> ListT m [a] #
Monad m => Applicative (ListT m) # |
Instance details Defined in Options.Applicative.Internal Methods pure :: a -> ListT m a # (<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b # liftA2 :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c # (*>) :: ListT m a -> ListT m b -> ListT m b # (<*) :: ListT m a -> ListT m b -> ListT m a #
Monad m => Functor (ListT m) # |
Instance details Defined in Options.Applicative.Internal Methods fmap :: (a -> b) -> ListT m a -> ListT m b # (<$) :: a -> ListT m b -> ListT m a #
Monad m => Monad (ListT m) # |
Instance details Defined in Options.Applicative.Internal Methods (>>=) :: ListT m a -> (a -> ListT m b) -> ListT m b # (>>) :: ListT m a -> ListT m b -> ListT m b # return :: a -> ListT m a #
Monad m => MonadPlus (ListT m) # |
Instance details Defined in Options.Applicative.Internal Methods mzero :: ListT m a # mplus :: ListT m a -> ListT m a -> ListT m a #

takeListT :: forall (m :: Type -> Type) a. Monad m => Int -> ListT m a -> ListT m a #

runListT :: Monad m => ListT m a -> m [a] #

hoistList :: Alternative m => [a] -> m a #

data NondetT (m :: Type -> Type) a #

#### Instances

Instances details

MonadTrans NondetT # |
Instance details Defined in Options.Applicative.Internal Methods lift :: Monad m => m a -> NondetT m a #
Monad m => Alternative (NondetT m) # |
Instance details Defined in Options.Applicative.Internal Methods empty :: NondetT m a # (<|>) :: NondetT m a -> NondetT m a -> NondetT m a # some :: NondetT m a -> NondetT m [a] # many :: NondetT m a -> NondetT m [a] #
Monad m => Applicative (NondetT m) # |
Instance details Defined in Options.Applicative.Internal Methods pure :: a -> NondetT m a # (<*>) :: NondetT m (a -> b) -> NondetT m a -> NondetT m b # liftA2 :: (a -> b -> c) -> NondetT m a -> NondetT m b -> NondetT m c # (*>) :: NondetT m a -> NondetT m b -> NondetT m b # (<*) :: NondetT m a -> NondetT m b -> NondetT m a #
Monad m => Functor (NondetT m) # |
Instance details Defined in Options.Applicative.Internal Methods fmap :: (a -> b) -> NondetT m a -> NondetT m b # (<$) :: a -> NondetT m b -> NondetT m a #
Monad m => Monad (NondetT m) # |
Instance details Defined in Options.Applicative.Internal Methods (>>=) :: NondetT m a -> (a -> NondetT m b) -> NondetT m b # (>>) :: NondetT m a -> NondetT m b -> NondetT m b # return :: a -> NondetT m a #
Monad m => MonadPlus (NondetT m) # |
Instance details Defined in Options.Applicative.Internal Methods mzero :: NondetT m a # mplus :: NondetT m a -> NondetT m a -> NondetT m a #

cut :: forall (m :: Type -> Type). Monad m => NondetT m () #

(<!>) :: forall (m :: Type -> Type) a. Monad m => NondetT m a -> NondetT m a -> NondetT m a #

disamb :: Monad m => Bool -> NondetT m a -> m (Maybe a) #