Copyright | (c) Abhinav Gupta 2015 |
---|---|
License | BSD3 |
Maintainer | Abhinav Gupta <mail@abhinavg.net> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Pinch.Internal.Parser
Description
Implements a basic parser for binary data. The parser does not do any extra book-keeping besides keeping track of the current position in the ByteString.
Documentation
A simple ByteString parser.
runParser :: Parser a -> ByteString -> Either String a Source
Run the parser on the given ByteString. Return either the failure message or the result.
runParser' :: Parser a -> ByteString -> Either String (ByteString, a) Source
Run the parser on the given ByteString. Return either the failure message or the result and any left-over content.
take :: Int -> Parser ByteString Source
take n
gets exactly n
bytes or fails the parse.