Options.Applicative.Internal

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

Safe Haskell | Safe
Language | Haskell98

Options.Applicative.Internal

# Documentation

data P a #

Instances

Monad P # |
Methods (>>=) :: P a -> (a -> P b) -> P b # (>>) :: P a -> P b -> P b # return :: a -> P a # fail :: String -> P a #
Functor P # |
Methods fmap :: (a -> b) -> P a -> P b # (<$) :: a -> P b -> P a #
Applicative P # |
Methods pure :: a -> P a # (<*>) :: P (a -> b) -> P a -> P b # (*>) :: P a -> P b -> P b # (<*) :: P a -> P b -> P a #
Alternative P # |
Methods empty :: P a # (<|>) :: P a -> P a -> P a # some :: P a -> P [a] # many :: P a -> P [a] #
MonadPlus P # |
Methods mzero :: P a # mplus :: P a -> P a -> P a #
MonadP P # |
Methods enterContext :: String -> ParserInfo a -> P () # exitContext :: P () # getPrefs :: P ParserPrefs # missingArgP :: ParseError -> Completer -> P a # tryP :: P a -> P (Either ParseError a) # errorP :: ParseError -> P a # exitP :: Parser b -> Either ParseError a -> P a #

data Context #

Constructors

Context String (ParserInfo a) |

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

Minimal complete definition

enterContext, exitContext, getPrefs, missingArgP, tryP, errorP, exitP

Methods

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

exitContext :: m () #

getPrefs :: m ParserPrefs #

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

tryP :: m a -> m (Either ParseError a) #

errorP :: ParseError -> m a #

exitP :: Parser b -> Either ParseError a -> m a #

Instances

MonadP Completion # |
Methods enterContext :: String -> ParserInfo a -> Completion () # exitContext :: Completion () # getPrefs :: Completion ParserPrefs # missingArgP :: ParseError -> Completer -> Completion a # tryP :: Completion a -> Completion (Either ParseError a) # errorP :: ParseError -> Completion a # exitP :: Parser b -> Either ParseError a -> Completion a #
MonadP P # |
Methods enterContext :: String -> ParserInfo a -> P () # exitContext :: P () # getPrefs :: P ParserPrefs # missingArgP :: ParseError -> Completer -> P a # tryP :: P a -> P (Either ParseError a) # errorP :: ParseError -> P a # exitP :: Parser b -> Either ParseError a -> P a #

data ParseError #

Constructors

ErrorMsg String |
InfoMsg String |
ShowHelpText |
UnknownError |
MissingError (OptTree (Chunk Doc)) |

Instances

Show ParseError # |
Methods showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS #
Monoid ParseError # |
Methods mempty :: ParseError # mappend :: ParseError -> ParseError -> ParseError # mconcat :: [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

Monad Completion # |
Methods (>>=) :: Completion a -> (a -> Completion b) -> Completion b # (>>) :: Completion a -> Completion b -> Completion b # return :: a -> Completion a # fail :: String -> Completion a #
Functor Completion # |
Methods fmap :: (a -> b) -> Completion a -> Completion b # (<$) :: a -> Completion b -> Completion a #
Applicative Completion # |
Methods pure :: a -> Completion a # (<*>) :: Completion (a -> b) -> Completion a -> Completion b # (*>) :: Completion a -> Completion b -> Completion b # (<*) :: Completion a -> Completion b -> Completion a #
Alternative Completion # |
Methods empty :: Completion a # (<|>) :: Completion a -> Completion a -> Completion a # some :: Completion a -> Completion [a] # many :: Completion a -> Completion [a] #
MonadPlus Completion # |
Methods mzero :: Completion a # mplus :: Completion a -> Completion a -> Completion a #
MonadP Completion # |
Methods enterContext :: String -> ParserInfo a -> Completion () # exitContext :: Completion () # getPrefs :: Completion ParserPrefs # missingArgP :: ParseError -> Completer -> Completion a # tryP :: Completion a -> Completion (Either ParseError a) # errorP :: ParseError -> Completion a # exitP :: Parser b -> Either ParseError a -> Completion a #

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

data SomeParser #

Constructors

SomeParser (Parser a) |

data ComplError #

Constructors

ComplParseError String |
ComplExit |

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

data ListT m a #

Instances

MonadTrans ListT # |
Methods lift :: Monad m => m a -> ListT m a #
Monad m => Monad (ListT m) # |
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 # fail :: String -> ListT m a #
Monad m => Functor (ListT m) # |
Methods fmap :: (a -> b) -> ListT m a -> ListT m b # (<$) :: a -> ListT m b -> ListT m a #
Monad m => Applicative (ListT m) # |
Methods pure :: a -> ListT m a # (<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b # (*>) :: ListT m a -> ListT m b -> ListT m b # (<*) :: ListT m a -> ListT m b -> ListT m a #
Monad m => Alternative (ListT m) # |
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 => MonadPlus (ListT m) # |
Methods mzero :: ListT m a # mplus :: ListT m a -> ListT m a -> ListT m a #

takeListT :: Monad m => Int -> ListT m a -> ListT m a #

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

data NondetT m a #

Instances

MonadTrans NondetT # |
Methods lift :: Monad m => m a -> NondetT m a #
Monad m => Monad (NondetT m) # |
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 # fail :: String -> NondetT m a #
Monad m => Functor (NondetT m) # |
Methods fmap :: (a -> b) -> NondetT m a -> NondetT m b # (<$) :: a -> NondetT m b -> NondetT m a #
Monad m => Applicative (NondetT m) # |
Methods pure :: a -> NondetT m a # (<*>) :: NondetT m (a -> b) -> NondetT m a -> NondetT m b # (*>) :: NondetT m a -> NondetT m b -> NondetT m b # (<*) :: NondetT m a -> NondetT m b -> NondetT m a #
Monad m => Alternative (NondetT m) # |
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 => MonadPlus (NondetT m) # |
Methods mzero :: NondetT m a # mplus :: NondetT m a -> NondetT m a -> NondetT m a #

cut :: Monad m => NondetT m () #

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

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