parsix-0.1.0.4: Parser combinators with slicing, error recovery, and syntax highlighting

Safe HaskellNone
LanguageHaskell2010

Text.Parsix.Parser

Synopsis

Documentation

data Parser a Source #

Instances
Monad Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

(>>=) :: Parser a -> (a -> Parser b) -> Parser b #

(>>) :: Parser a -> Parser b -> Parser b #

return :: a -> Parser a #

fail :: String -> Parser a #

Functor Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

fmap :: (a -> b) -> Parser a -> Parser b #

(<$) :: a -> Parser b -> Parser a #

MonadFail Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

fail :: String -> Parser a #

Applicative Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

pure :: a -> Parser a #

(<*>) :: Parser (a -> b) -> Parser a -> Parser b #

liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c #

(*>) :: Parser a -> Parser b -> Parser b #

(<*) :: Parser a -> Parser b -> Parser a #

Alternative Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

empty :: Parser a #

(<|>) :: Parser a -> Parser a -> Parser a #

some :: Parser a -> Parser [a] #

many :: Parser a -> Parser [a] #

MonadPlus Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

mzero :: Parser a #

mplus :: Parser a -> Parser a -> Parser a #

TokenParsing Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

LookAheadParsing Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

lookAhead :: Parser a -> Parser a #

CharParsing Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Parsing Parser Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

try :: Parser a -> Parser a #

(<?>) :: Parser a -> String -> Parser a #

skipMany :: Parser a -> Parser () #

skipSome :: Parser a -> Parser () #

unexpected :: String -> Parser a #

eof :: Parser () #

notFollowedBy :: Show a => Parser a -> Parser () #

RecoveryParsing Parser Source # 
Instance details

Defined in Text.Parsix.Combinators

Methods

withRecovery :: (ErrorInfo -> Parser a) -> Parser a -> Parser a Source #

SliceParsing Parser Source # 
Instance details

Defined in Text.Parsix.Combinators

Methods

slicedWith :: (a -> Text -> b) -> Parser a -> Parser b Source #

position :: Parser Position Source #

Semigroup a => Semigroup (Parser a) Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

(<>) :: Parser a -> Parser a -> Parser a #

sconcat :: NonEmpty (Parser a) -> Parser a #

stimes :: Integral b => b -> Parser a -> Parser a #

Monoid a => Monoid (Parser a) Source # 
Instance details

Defined in Text.Parsix.Parser.Internal

Methods

mempty :: Parser a #

mappend :: Parser a -> Parser a -> Parser a #

mconcat :: [Parser a] -> Parser a #

parseText :: Parser a -> Text -> FilePath -> Result a Source #

parseText p i file runs a parser p on i. file is only used for reporting errors.

parseString :: Parser a -> String -> FilePath -> Result a Source #

parseString p i file runs a parser p on i. file is only used for reporting errors.

parseTest :: (MonadIO m, Show a) => Parser a -> String -> m () Source #

Parse some input and print the result to the console.