-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A highly-efficient but limited parser API specialised for bytestrings
--   
--   A highly-efficient but limited parser API specialised for bytestrings
@package binary-parser
@version 0.5.2

module BinaryParser

-- | A highly-efficient parser specialised for strict <a>ByteString</a>s.
--   
--   Supports the roll-back and alternative branching on the basis of the
--   <a>Alternative</a> interface.
--   
--   Does not generate fancy error-messages, which contributes to its
--   efficiency.
data BinaryParser a

-- | Apply a parser to bytes.
run :: BinaryParser a -> ByteString -> Either Text a

-- | Fail with a message.
failure :: Text -> BinaryParser a

-- | Consume a single byte.
byte :: BinaryParser Word8

-- | Consume an amount of bytes.
bytesOfSize :: Int -> BinaryParser ByteString

-- | Skip an amount of bytes.
unitOfSize :: Int -> BinaryParser ()

-- | Skip specific bytes, while failing if they don't match.
unitOfBytes :: ByteString -> BinaryParser ()

-- | Consume all the remaining bytes.
remainders :: BinaryParser ByteString

-- | Fail if the input hasn't ended.
endOfInput :: BinaryParser ()

-- | Run a subparser passing it a chunk of the current input of the
--   specified size.
sized :: Int -> BinaryParser a -> BinaryParser a
instance GHC.Base.MonadPlus BinaryParser.BinaryParser
instance GHC.Base.Monad BinaryParser.BinaryParser
instance GHC.Base.Alternative BinaryParser.BinaryParser
instance GHC.Base.Applicative BinaryParser.BinaryParser
instance GHC.Base.Functor BinaryParser.BinaryParser
