parsers-megaparsec-0.1.0.0: `parsers` instances for Megaparsec

Safe HaskellNone
LanguageHaskell2010

Text.Megaparsec.Parsers

Description

A newtype wrapper for ParsecT that has instances of Parsing, CharParsing, LookAheadParsing, and TokenParsing.

Parsing and LookAheadParsing have instances for any Stream instance.

CharParsing and TokenParsing only have instances for String, strict Text, and lazy Text, because those type classes expect the Token type to be Char

Documentation

newtype ParsecT e s m a Source #

Constructors

ParsecT 

Fields

Instances

(Ord e, Stream s) => MonadParsec e s (ParsecT e s m) Source # 

Methods

failure :: Maybe (ErrorItem (Token s)) -> Set (ErrorItem (Token s)) -> ParsecT e s m a #

fancyFailure :: Set (ErrorFancy e) -> ParsecT e s m a #

label :: String -> ParsecT e s m a -> ParsecT e s m a #

hidden :: ParsecT e s m a -> ParsecT e s m a #

try :: ParsecT e s m a -> ParsecT e s m a #

lookAhead :: ParsecT e s m a -> ParsecT e s m a #

notFollowedBy :: ParsecT e s m a -> ParsecT e s m () #

withRecovery :: (ParseError (Token s) e -> ParsecT e s m a) -> ParsecT e s m a -> ParsecT e s m a #

observing :: ParsecT e s m a -> ParsecT e s m (Either (ParseError (Token s) e) a) #

eof :: ParsecT e s m () #

token :: (Token s -> Either (Maybe (ErrorItem (Token s)), Set (ErrorItem (Token s))) a) -> Maybe (Token s) -> ParsecT e s m a #

tokens :: (Tokens s -> Tokens s -> Bool) -> Tokens s -> ParsecT e s m (Tokens s) #

takeWhileP :: Maybe String -> (Token s -> Bool) -> ParsecT e s m (Tokens s) #

takeWhile1P :: Maybe String -> (Token s -> Bool) -> ParsecT e s m (Tokens s) #

takeP :: Maybe String -> Int -> ParsecT e s m (Tokens s) #

getParserState :: ParsecT e s m (State s) #

updateParserState :: (State s -> State s) -> ParsecT e s m () #

(MonadState st m, Stream s) => MonadState st (ParsecT e s m) Source # 

Methods

get :: ParsecT e s m st #

put :: st -> ParsecT e s m () #

state :: (st -> (a, st)) -> ParsecT e s m a #

(MonadReader r m, Stream s) => MonadReader r (ParsecT e s m) Source # 

Methods

ask :: ParsecT e s m r #

local :: (r -> r) -> ParsecT e s m a -> ParsecT e s m a #

reader :: (r -> a) -> ParsecT e s m a #

(MonadError e' m, Stream s) => MonadError e' (ParsecT e s m) Source # 

Methods

throwError :: e' -> ParsecT e s m a #

catchError :: ParsecT e s m a -> (e' -> ParsecT e s m a) -> ParsecT e s m a #

MonadTrans (ParsecT e s) Source # 

Methods

lift :: Monad m => m a -> ParsecT e s m a #

Stream s => Monad (ParsecT e s m) Source # 

Methods

(>>=) :: ParsecT e s m a -> (a -> ParsecT e s m b) -> ParsecT e s m b #

(>>) :: ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m b #

return :: a -> ParsecT e s m a #

fail :: String -> ParsecT e s m a #

Functor (ParsecT e s m) Source # 

Methods

fmap :: (a -> b) -> ParsecT e s m a -> ParsecT e s m b #

(<$) :: a -> ParsecT e s m b -> ParsecT e s m a #

Stream s => MonadFail (ParsecT e s m) Source # 

Methods

fail :: String -> ParsecT e s m a #

Stream s => Applicative (ParsecT e s m) Source # 

Methods

pure :: a -> ParsecT e s m a #

(<*>) :: ParsecT e s m (a -> b) -> ParsecT e s m a -> ParsecT e s m b #

liftA2 :: (a -> b -> c) -> ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m c #

(*>) :: ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m b #

(<*) :: ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m a #

(Ord e, Stream s) => Alternative (ParsecT e s m) Source # 

Methods

empty :: ParsecT e s m a #

(<|>) :: ParsecT e s m a -> ParsecT e s m a -> ParsecT e s m a #

some :: ParsecT e s m a -> ParsecT e s m [a] #

many :: ParsecT e s m a -> ParsecT e s m [a] #

(Ord e, Stream s) => MonadPlus (ParsecT e s m) Source # 

Methods

mzero :: ParsecT e s m a #

mplus :: ParsecT e s m a -> ParsecT e s m a -> ParsecT e s m a #

(MonadIO m, Stream s) => MonadIO (ParsecT e s m) Source # 

Methods

liftIO :: IO a -> ParsecT e s m a #

(MonadCont m, Stream s) => MonadCont (ParsecT e s m) Source # 

Methods

callCC :: ((a -> ParsecT e s m b) -> ParsecT e s m a) -> ParsecT e s m a #

Ord e => TokenParsing (ParsecT e Text m) Source #

Strict Text

Methods

someSpace :: ParsecT e Text m () #

nesting :: ParsecT e Text m a -> ParsecT e Text m a #

semi :: ParsecT e Text m Char #

highlight :: Highlight -> ParsecT e Text m a -> ParsecT e Text m a #

token :: ParsecT e Text m a -> ParsecT e Text m a #

Ord e => TokenParsing (ParsecT e Text m) Source #

Lazy Text

Methods

someSpace :: ParsecT e Text m () #

nesting :: ParsecT e Text m a -> ParsecT e Text m a #

semi :: ParsecT e Text m Char #

highlight :: Highlight -> ParsecT e Text m a -> ParsecT e Text m a #

token :: ParsecT e Text m a -> ParsecT e Text m a #

Ord e => TokenParsing (ParsecT e String m) Source # 

Methods

someSpace :: ParsecT e String m () #

nesting :: ParsecT e String m a -> ParsecT e String m a #

semi :: ParsecT e String m Char #

highlight :: Highlight -> ParsecT e String m a -> ParsecT e String m a #

token :: ParsecT e String m a -> ParsecT e String m a #

(Ord e, Stream s) => LookAheadParsing (ParsecT e s m) Source # 

Methods

lookAhead :: ParsecT e s m a -> ParsecT e s m a #

Ord e => CharParsing (ParsecT e Text m) Source #

Strict Text

Ord e => CharParsing (ParsecT e Text m) Source #

Lazy Text

Ord e => CharParsing (ParsecT e String m) Source # 
(Ord e, Stream s) => Parsing (ParsecT e s m) Source #

Note: unexpected requires a non-empty string

Methods

try :: ParsecT e s m a -> ParsecT e s m a #

(<?>) :: ParsecT e s m a -> String -> ParsecT e s m a #

skipMany :: ParsecT e s m a -> ParsecT e s m () #

skipSome :: ParsecT e s m a -> ParsecT e s m () #

unexpected :: String -> ParsecT e s m a #

eof :: ParsecT e s m () #

notFollowedBy :: Show a => ParsecT e s m a -> ParsecT e s m () #

(Semigroup a, Stream s) => Semigroup (ParsecT e s m a) Source # 

Methods

(<>) :: ParsecT e s m a -> ParsecT e s m a -> ParsecT e s m a #

sconcat :: NonEmpty (ParsecT e s m a) -> ParsecT e s m a #

stimes :: Integral b => b -> ParsecT e s m a -> ParsecT e s m a #

(Monoid a, Stream s) => Monoid (ParsecT e s m a) Source # 

Methods

mempty :: ParsecT e s m a #

mappend :: ParsecT e s m a -> ParsecT e s m a -> ParsecT e s m a #

mconcat :: [ParsecT e s m a] -> ParsecT e s m a #