Module
Text.Parsing.Parser
- Package
- purescript-parsing
- Repository
- purescript-contrib/purescript-parsing
#ParseError Source
data ParseErrorA parsing error, consisting of a message and position information.
Constructors
Instances
Show ParseErrorEq ParseErrorOrd ParseError(Monad m) => MonadThrow ParseError (ParserT s m)(Monad m) => MonadError ParseError (ParserT s m)
#ParseState Source
data ParseState sContains the remaining input and current position.
Constructors
Instances
(Monad m) => MonadState (ParseState s) (ParserT s m)
#ParserT Source
newtype ParserT :: Type -> (Type -> Type) -> Type -> Typenewtype 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
ParserT (ExceptT ParseError (StateT (ParseState s) m) a)
Instances
Newtype (ParserT s m a) _Lazy (ParserT s m a)(Monad m, Semigroup a) => Semigroup (ParserT s m a)(Monad m, Monoid a) => Monoid (ParserT s m a)(Functor m) => Functor (ParserT s m)(Monad m) => Apply (ParserT s m)(Monad m) => Applicative (ParserT s m)(Monad m) => Bind (ParserT s m)(Monad m) => Monad (ParserT s m)(MonadRec m) => MonadRec (ParserT s m)(Monad m) => MonadState (ParseState s) (ParserT s m)(Monad m) => MonadThrow ParseError (ParserT s m)(Monad m) => MonadError ParseError (ParserT s m)(Monad m) => Alt (ParserT s m)(Monad m) => Plus (ParserT s m)(Monad m) => Alternative (ParserT s m)(Monad m) => MonadZero (ParserT s m)(Monad m) => MonadPlus (ParserT s m)MonadTrans (ParserT s)
#runParser Source
runParser :: forall s a. s -> Parser s a -> Either ParseError aApply a parser, keeping only the parsed result.
#runParserT Source
runParserT :: forall m s a. Monad m => s -> ParserT s m a -> m (Either ParseError a)Apply a parser, keeping only the parsed result.
#mapParserT Source
mapParserT :: forall b n s a m. (m (Tuple (Either ParseError a) (ParseState s)) -> n (Tuple (Either ParseError b) (ParseState s))) -> ParserT s m a -> ParserT s n bChange the underlying monad action and data type in a ParserT monad action.
#failWithPosition Source
failWithPosition :: forall m s a. Monad m => String -> Position -> ParserT s m aFail with a message and a position.
#region Source
region :: forall m s a. Monad m => (ParseError -> ParseError) -> ParserT s m a -> ParserT s m aContextualize parsing failures inside a region. If a parsing failure
occurs, then the ParseError will be transformed by each containing
region as the parser backs out the call stack.