comark-parser-0.1.0: Parser for Commonmark (markdown)

Safe HaskellSafe
LanguageHaskell2010

Comark.ParserCombinators

Synopsis

Documentation

data Parser a Source #

Instances

Monad Parser Source # 

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 # 

Methods

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

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

Applicative Parser Source # 

Methods

pure :: a -> Parser a #

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

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

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

Alternative Parser Source # 

Methods

empty :: Parser a #

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

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

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

MonadPlus Parser Source # 

Methods

mzero :: Parser a #

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

(~) * a Text => IsString (Parser a) Source # 

Methods

fromString :: String -> Parser a #

(<?>) :: Parser a -> String -> Parser a infixl 5 Source #

withConsumed :: Parser a -> Parser (a, Text) Source #

Returns the text that was consumed by a parser alongside with its result

peekChar :: Parser (Maybe Char) Source #

Get the next character without consuming it.

peekLastChar :: Parser (Maybe Char) Source #

Get the last consumed character.

untilTheEnd :: Parser Text Source #

Consumes all the available input (until endOfInput) and returns it.

skip :: (Char -> Bool) -> Parser () Source #

replacing :: Parser Text -> Parser () Source #

Takes a parser that returns a Text, runs that parser consuming some input and then prepends the result to the rest of subject.

scan :: s -> (s -> Char -> Maybe s) -> Parser Text Source #

option :: Alternative f => a -> f a -> f a Source #

foldP :: (b -> Parser (Maybe b)) -> b -> Parser b Source #

manyTill :: Alternative f => f a -> f b -> f [a] Source #

someTill :: Alternative f => f a -> f b -> f [a] Source #

sepBy1 :: Alternative f => f a -> f s -> f [a] Source #

sepEndBy1 :: Alternative f => f a -> f s -> f [a] Source #

sepStartEndBy1 :: Alternative f => f a -> f s -> f [a] Source #

skipMany :: Alternative f => f a -> f () Source #

skipMany1 :: Alternative f => f a -> f () Source #

discardOpt :: Alternative f => f a -> f () Source #

decimal :: Integral a => Parser a Source #

Parse and decode an unsigned decimal number.