Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Options.Applicative.Internal
Documentation
class (Alternative m, MonadPlus m) => MonadP m where Source #
Minimal complete definition
enterContext, exitContext, getPrefs, missingArgP, tryP, errorP, exitP
Methods
enterContext :: String -> ParserInfo a -> m () Source #
exitContext :: m () Source #
getPrefs :: m ParserPrefs Source #
missingArgP :: ParseError -> Completer -> m a Source #
tryP :: m a -> m (Either ParseError a) Source #
errorP :: ParseError -> m a Source #
exitP :: IsCmdStart -> ArgPolicy -> Parser b -> Maybe a -> m a Source #
data ParseError Source #
Constructors
ErrorMsg String | |
InfoMsg String | |
ShowHelpText | |
UnknownError | |
MissingError IsCmdStart SomeParser | |
ExpectsArgError String | |
UnexpectedError String SomeParser |
Instances
hoistMaybe :: MonadPlus m => Maybe a -> m a Source #
hoistEither :: MonadP m => Either ParseError a -> m a Source #
runP :: P a -> ParserPrefs -> (Either ParseError a, [Context]) Source #
data Completion a Source #
runCompletion :: Completion r -> ParserPrefs -> Maybe (Either (SomeParser, ArgPolicy) Completer) Source #
contextNames :: [Context] -> [String] Source #