Copyright | (C) 2016-2025 David M. Johnson (@dmjio) |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <code@dmj.io> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Miso.Util.Parser
Contents
Description
Synopsis
- newtype Parser token a = Parser {
- runParser :: [token] -> [([token], a)]
- data ParseError a token
- = UnexpectedParse [token]
- | LexicalError LexerError
- | Ambiguous [([token], a)]
- | NoParses token
- | EmptyStream
- parse :: Parser token a -> [token] -> Either (ParseError a token) a
- satisfy :: (token -> Bool) -> Parser token token
- peek :: Parser a a
- token_ :: Eq token => token -> Parser token token
Types
newtype Parser token a Source #
Instances
Alternative (Parser token) Source # | |
Applicative (Parser token) Source # | |
Defined in Miso.Util.Parser | |
Functor (Parser token) Source # | |
Monad (Parser token) Source # | |
data ParseError a token Source #
Constructors
UnexpectedParse [token] | |
LexicalError LexerError | |
Ambiguous [([token], a)] | |
NoParses token | |
EmptyStream |
Instances
(Show a, Show token) => Show (ParseError a token) Source # | |
Defined in Miso.Util.Parser Methods showsPrec :: Int -> ParseError a token -> ShowS # show :: ParseError a token -> String # showList :: [ParseError a token] -> ShowS # | |
(Eq a, Eq token) => Eq (ParseError a token) Source # | |
Defined in Miso.Util.Parser Methods (==) :: ParseError a token -> ParseError a token -> Bool # (/=) :: ParseError a token -> ParseError a token -> Bool # |