Module
StringParser.Parser
- Package
- purescript-string-parsers
- Repository
- purescript-contrib/purescript-string-parsers
This module defines the Parser type of string parsers, and its instances.
#ParseError Source
type ParseError = { error :: String, pos :: Pos }The type of parsing errors.
#Parser Source
newtype Parser aA parser is represented as a function that, when successful, returns
a result and the position where the parse finished or, when it fails,
a ParserError with more information on where and why it failed.
See also printParserError.
Constructors
Parser (PosString -> Either ParseError { result :: a, suffix :: PosString })
Instances
#runParser Source
runParser :: forall a. Parser a -> String -> Either ParseError aRun a parser for an input string. See also printParserError
and unParser for more flexible usages.
#printParserError Source
printParserError :: ParseError -> StringPrints a ParseError's the error message and the position of the error.