bytestringparser-0.3: Combinator parsing with Data.ByteString.LazySource codeContentsIndex
Data.ParserCombinators.Attoparsec.Internal
Portabilityunknown
Stabilityexperimental
Maintainerbos@serpentine.com
Contents
Parser
Running parsers
Combinators
Things vaguely like those in Parsec.Combinator (and Parsec.Prim)
Things like in Parsec.Char
Parser converters.
Miscellaneous functions.
Description
Simple, efficient parser combinators for lazy ByteString strings, loosely based on Text.ParserCombinators.Parsec.
Synopsis
type ParseError = String
data Parser a
parse :: Parser a -> ByteString -> (ByteString, Either ParseError a)
parseAt :: Parser a -> ByteString -> Int64 -> (ByteString, Either ParseError (a, Int64))
parseTest :: Show a => Parser a -> ByteString -> IO ()
(<?>) :: Parser a -> String -> Parser a
try :: Parser a -> Parser a
manyTill :: Parser a -> Parser b -> Parser [a]
eof :: Parser ()
skipMany :: Parser a -> Parser ()
skipMany1 :: Parser a -> Parser ()
count :: Int -> Parser a -> Parser [a]
lookAhead :: Parser a -> Parser a
peek :: Parser a -> Parser (Maybe a)
sepBy :: Parser a -> Parser s -> Parser [a]
sepBy1 :: Parser a -> Parser s -> Parser [a]
satisfy :: (Word8 -> Bool) -> Parser Word8
anyWord8 :: Parser Word8
word8 :: Word8 -> Parser Word8
notWord8 :: Word8 -> Parser Word8
string :: ByteString -> Parser ByteString
stringTransform :: (ByteString -> ByteString) -> ByteString -> Parser ByteString
eitherP :: Parser a -> Parser b -> Parser (Either a b)
getInput :: Parser ByteString
getConsumed :: Parser Int64
takeWhile :: (Word8 -> Bool) -> Parser ByteString
takeWhile1 :: (Word8 -> Bool) -> Parser ByteString
takeTill :: (Word8 -> Bool) -> Parser ByteString
takeAll :: Parser ByteString
skipWhile :: (Word8 -> Bool) -> Parser ()
notEmpty :: Parser ByteString -> Parser ByteString
match :: Parser a -> Parser ByteString
Parser
type ParseError = StringSource
data Parser a Source
show/hide Instances
Running parsers
parse :: Parser a -> ByteString -> (ByteString, Either ParseError a)Source
Run a parser.
parseAt :: Parser a -> ByteString -> Int64 -> (ByteString, Either ParseError (a, Int64))Source
parseTest :: Show a => Parser a -> ByteString -> IO ()Source
Combinators
(<?>) :: Parser a -> String -> Parser aSource
Name the parser.
Things vaguely like those in Parsec.Combinator (and Parsec.Prim)
try :: Parser a -> Parser aSource
manyTill :: Parser a -> Parser b -> Parser [a]Source
eof :: Parser ()Source
Detect 'end of file'.
skipMany :: Parser a -> Parser ()Source
skipMany - skip zero or many instances of the parser
skipMany1 :: Parser a -> Parser ()Source
skipMany1 - skip one or many instances of the parser
count :: Int -> Parser a -> Parser [a]Source
Apply the given parser repeatedly, returning every parse result.
lookAhead :: Parser a -> Parser aSource
peek :: Parser a -> Parser (Maybe a)Source
sepBy :: Parser a -> Parser s -> Parser [a]Source
sepBy1 :: Parser a -> Parser s -> Parser [a]Source
Things like in Parsec.Char
satisfy :: (Word8 -> Bool) -> Parser Word8Source
Character parser.
anyWord8 :: Parser Word8Source
word8 :: Word8 -> Parser Word8Source
Satisfy a specific character.
notWord8 :: Word8 -> Parser Word8Source
Satisfy a specific character.
string :: ByteString -> Parser ByteStringSource
Satisfy a literal string.
stringTransform :: (ByteString -> ByteString) -> ByteString -> Parser ByteStringSource
Satisfy a literal string, after applying a transformation to both it and the matching text.
Parser converters.
eitherP :: Parser a -> Parser b -> Parser (Either a b)Source
Miscellaneous functions.
getInput :: Parser ByteStringSource
Get remaining input.
getConsumed :: Parser Int64Source
Get number of bytes consumed so far.
takeWhile :: (Word8 -> Bool) -> Parser ByteStringSource
Consume characters while the predicate is true.
takeWhile1 :: (Word8 -> Bool) -> Parser ByteStringSource
takeTill :: (Word8 -> Bool) -> Parser ByteStringSource
takeAll :: Parser ByteStringSource
skipWhile :: (Word8 -> Bool) -> Parser ()Source
Skip over characters while the predicate is true.
notEmpty :: Parser ByteString -> Parser ByteStringSource
Test that a parser returned a non-null ByteString.
match :: Parser a -> Parser ByteStringSource
Parse some input with the given parser and return that input without copying it.
Produced by Haddock version 2.4.2