Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
BinaryParser
Contents
dataBinaryParser aSource#
A highly-efficient parser specialised for strictByteString
s.
Supports the roll-back and alternative branching on the basis of theAlternative
interface.
Does not generate fancy error-messages, which contributes to its efficiency.
run ::BinaryParser a ->ByteString ->EitherText aSource#
Apply a parser to bytes.
failure ::Text ->BinaryParser aSource#
Fail with a message.
byte ::BinaryParserWord8Source#
Consume a single byte.
matchingByte :: (Word8 ->EitherText a) ->BinaryParser aSource#
Consume a single byte, which satisfies the predicate.
bytesOfSize ::Int ->BinaryParserByteStringSource#
Consume an amount of bytes.
bytesWhile :: (Word8 ->Bool) ->BinaryParserByteStringSource#
Consume multiple bytes, which satisfy the predicate.
unitOfSize ::Int ->BinaryParser ()Source#
Skip an amount of bytes.
unitOfBytes ::ByteString ->BinaryParser ()Source#
Skip specific bytes, while failing if they don't match.
remainders ::BinaryParserByteStringSource#
Consume all the remaining bytes.
fold :: (a ->Word8 ->Maybe a) -> a ->BinaryParser aSource#
Left-fold the bytes, terminating before the byte, on which the step function returns Nothing.
endOfInput ::BinaryParser ()Source#
Fail if the input hasn't ended.
sized ::Int ->BinaryParser a ->BinaryParser aSource#
Run a subparser passing it a chunk of the current input of the specified size.
storableOfSize ::Storable a =>Int ->BinaryParser aSource#
Storable value of the given amount of bytes.
beWord16 ::BinaryParserWord16Source#
Big-endian word of 2 bytes.
leWord16 ::BinaryParserWord16Source#
Little-endian word of 2 bytes.
beWord32 ::BinaryParserWord32Source#
Big-endian word of 4 bytes.
leWord32 ::BinaryParserWord32Source#
Little-endian word of 4 bytes.
beWord64 ::BinaryParserWord64Source#
Big-endian word of 8 bytes.
leWord64 ::BinaryParserWord64Source#
Little-endian word of 8 bytes.
asciiIntegral ::Integral a =>BinaryParser aSource#
Integral number encoded in ASCII.
Produced byHaddock version 2.29.1