Module

Text.Parsing.Parser

Package
purescript-parsing
Repository
purescript-contrib/purescript-parsing

#ParseError Source

data ParseError

A parsing error, consisting of a message and position information.

Instances

#ParseState Source

data ParseState s

Contains the remaining input and current position.

Constructors

Instances

#ParserT Source

newtype ParserT s m a

The Parser monad transformer.

The first type argument is the stream type. Typically, this is either String, or some sort of token stream.

Constructors

Instances

#runParserT Source

runParserT :: forall a s m. Monad m => s -> ParserT s m a -> m (Either ParseError a)

Apply a parser, keeping only the parsed result.

#Parser Source

type Parser s = ParserT s Identity

The Parser monad is a synonym for the parser monad transformer applied to the Identity monad.

#runParser Source

runParser :: forall a s. s -> Parser s a -> Either ParseError a

Apply a parser, keeping only the parsed result.

#hoistParserT Source

hoistParserT :: forall a n m s. (m ~> n) -> ParserT s m a -> ParserT s n a

#consume Source

consume :: forall m s. Monad m => ParserT s m Unit

Set the consumed flag.

#fail Source

fail :: forall a s m. Monad m => String -> ParserT s m a

Fail with a message.