parsers-megaparsec-0.1.0.1: `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
(Stream s, Ord e) => MonadParsec e s (ParsecT e s m) Source # 
Instance details

Defined in Text.Megaparsec.Parsers

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 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 s e) a) #

eof :: ParsecT e s m () #

token :: (Token s -> Maybe a) -> Set (ErrorItem (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 () #

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

Defined in Text.Megaparsec.Parsers

Methods

get :: ParsecT e s m st #

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

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

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

Defined in Text.Megaparsec.Parsers

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 #

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

Defined in Text.Megaparsec.Parsers

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 # 
Instance details

Defined in Text.Megaparsec.Parsers

Methods

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

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

Defined in Text.Megaparsec.Parsers

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 # 
Instance details

Defined in Text.Megaparsec.Parsers

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 # 
Instance details

Defined in Text.Megaparsec.Parsers

Methods

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

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

Defined in Text.Megaparsec.Parsers

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 #

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

Defined in Text.Megaparsec.Parsers

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] #

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

Defined in Text.Megaparsec.Parsers

Methods

mzero :: ParsecT e s m a #

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

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

Defined in Text.Megaparsec.Parsers

Methods

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

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

Defined in Text.Megaparsec.Parsers

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

Instance details

Defined in Text.Megaparsec.Parsers

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

Instance details

Defined in Text.Megaparsec.Parsers

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 # 
Instance details

Defined in Text.Megaparsec.Parsers

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 # 
Instance details

Defined in Text.Megaparsec.Parsers

Methods

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

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

Strict Text

Instance details

Defined in Text.Megaparsec.Parsers

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

Lazy Text

Instance details

Defined in Text.Megaparsec.Parsers

Ord e => CharParsing (ParsecT e String m) Source # 
Instance details

Defined in Text.Megaparsec.Parsers

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

Note: unexpected requires a non-empty string

Instance details

Defined in Text.Megaparsec.Parsers

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 () #

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

Defined in Text.Megaparsec.Parsers

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 #

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

Defined in Text.Megaparsec.Parsers

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 #