bytestringparser-0.3: Combinator parsing with Data.ByteString.LazySource codeContentsIndex
Data.ParserCombinators.Attoparsec.Char8
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 :: (Char -> Bool) -> Parser Char
letter :: Parser Char
digit :: Parser Char
anyChar :: Parser Char
space :: Parser Char
char :: Char -> Parser Char
notChar :: Char -> Parser Char
string :: ByteString -> Parser ByteString
stringCI :: ByteString -> Parser ByteString
eitherP :: Parser a -> Parser b -> Parser (Either a b)
getInput :: Parser ByteString
getConsumed :: Parser Int64
takeWhile :: (Char -> Bool) -> Parser ByteString
takeWhile1 :: (Char -> Bool) -> Parser ByteString
takeTill :: (Char -> Bool) -> Parser ByteString
takeAll :: Parser ByteString
skipWhile :: (Char -> Bool) -> Parser ()
skipSpace :: Parser ()
notEmpty :: Parser ByteString -> Parser ByteString
match :: Parser a -> Parser ByteString
inClass :: String -> Char -> Bool
notInClass :: String -> Char -> Bool
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 :: (Char -> Bool) -> Parser CharSource
Character parser.
letter :: Parser CharSource
digit :: Parser CharSource
anyChar :: Parser CharSource
space :: Parser CharSource
char :: Char -> Parser CharSource
Satisfy a specific character.
notChar :: Char -> Parser CharSource
Satisfy a specific character.
string :: ByteString -> Parser ByteStringSource
Satisfy a literal string.
stringCI :: ByteString -> Parser ByteStringSource
Satisfy a literal string, ignoring case.
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 :: (Char -> Bool) -> Parser ByteStringSource
Consume characters while the predicate is true.
takeWhile1 :: (Char -> Bool) -> Parser ByteStringSource
takeTill :: (Char -> Bool) -> Parser ByteStringSource
takeAll :: Parser ByteStringSource
skipWhile :: (Char -> Bool) -> Parser ()Source
Skip over characters while the predicate is true.
skipSpace :: Parser ()Source
Skip over white space.
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.
inClass :: String -> Char -> BoolSource
notInClass :: String -> Char -> BoolSource
Produced by Haddock version 2.4.2