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.
Constructors
Instances
Show ParseError
Eq ParseError
Ord ParseError
(Monad m) => MonadThrow ParseError (ParserT s m)
(Monad m) => MonadError ParseError (ParserT s m)
#ParseState Source
data ParseState s
Contains the remaining input and current position.
Constructors
Instances
(Monad m) => MonadState (ParseState s) (ParserT s m)
#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
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 a s. s -> Parser s a -> Either ParseError a
Apply a parser, keeping only the parsed result.
#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.
#mapParserT Source
mapParserT :: forall m a s n b. (m (Tuple (Either ParseError a) (ParseState s)) -> n (Tuple (Either ParseError b) (ParseState s))) -> ParserT s m a -> ParserT s n b
Change the underlying monad action and data type in a ParserT monad action.