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


-- | Parser and printer for bencoded data.
--   
--   Parser and printer for bencoded data.
--   
--   Bencode (pronounced like B encode) is the encoding used by the
--   peer-to-peer file sharing system BitTorrent for storing and
--   transmitting loosely structured data.
@package bencode
@version 0.6.0.0


module Data.BEncode.Lexer
data Token
TDict :: Token
TList :: Token
TInt :: Token
TString :: ByteString -> Token
TNumber :: Integer -> Token
TEnd :: Token
lexer :: ByteString -> [Token]
instance GHC.Classes.Eq Data.BEncode.Lexer.Token
instance GHC.Show.Show Data.BEncode.Lexer.Token


-- | Provides a BEncode data type is well as functions for converting this
--   data type to and from a String.
--   
--   Also supplies a number of properties which the module must satisfy.
module Data.BEncode

-- | The B-coding defines an abstract syntax tree given as a simple data
--   type here
data BEncode
BInt :: Integer -> BEncode
BString :: ByteString -> BEncode
BList :: [BEncode] -> BEncode
BDict :: (Map String BEncode) -> BEncode

-- | bRead is a conversion routine. It assumes a B-coded string as input
--   and attempts a parse of it into a BEncode data type
bRead :: ByteString -> Maybe BEncode

-- | Render a BEncode structure to a B-coded string
bShow :: BEncode -> ShowS
bPack :: BEncode -> ByteString
instance GHC.Show.Show Data.BEncode.BEncode
instance GHC.Classes.Ord Data.BEncode.BEncode
instance GHC.Classes.Eq Data.BEncode.BEncode
instance Data.Binary.Class.Binary Data.BEncode.BEncode


-- | A parsec style parser for BEncoded data
module Data.BEncode.Parser
data BParser a
runParser :: BParser a -> BEncode -> Either String a
token :: BParser BEncode
dict :: String -> BParser BEncode
list :: String -> BParser a -> BParser [a]
optional :: BParser a -> BParser (Maybe a)
bstring :: BParser BEncode -> BParser String
bbytestring :: BParser BEncode -> BParser ByteString
bint :: BParser BEncode -> BParser Integer
setInput :: BEncode -> BParser ()

-- | An associative binary operation
(<|>) :: Alternative f => forall a. f a -> f a -> f a
instance GHC.Base.Alternative Data.BEncode.Parser.BParser
instance GHC.Base.MonadPlus Data.BEncode.Parser.BParser
instance GHC.Base.Applicative Data.BEncode.Parser.BParser
instance GHC.Base.Monad Data.BEncode.Parser.BParser
instance GHC.Base.Functor Data.BEncode.Parser.BParser
