Data.BEncode.Parser

bencode-0.6.0.0: Parser and printer for bencoded data.

Copyright | (c) 2005 Lemmih <lemmih@gmail.com>
License | BSD3
Maintainer | lemmih@gmail.com
Stability | stable
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Data.BEncode.Parser

Description

A parsec style parser for BEncoded data

Synopsis

- 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 ()
- (<|>) :: Alternative f => forall a. f a -> f a -> f a

# Documentation

data BParser a #

Instances

Monad BParser # |
Methods (>>=) :: BParser a -> (a -> BParser b) -> BParser b # (>>) :: BParser a -> BParser b -> BParser b # return :: a -> BParser a # fail :: String -> BParser a #
Functor BParser # |
Methods fmap :: (a -> b) -> BParser a -> BParser b # (<$) :: a -> BParser b -> BParser a #
Applicative BParser # |
Methods pure :: a -> BParser a # (<*>) :: BParser (a -> b) -> BParser a -> BParser b # (*>) :: BParser a -> BParser b -> BParser b # (<*) :: BParser a -> BParser b -> BParser a #
Alternative BParser # |
Methods empty :: BParser a # (<|>) :: BParser a -> BParser a -> BParser a # some :: BParser a -> BParser [a] # many :: BParser a -> BParser [a] #
MonadPlus BParser # |
Methods mzero :: BParser a # mplus :: BParser a -> BParser a -> 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 () #

(<|>) :: Alternative f => forall a. f a -> f a -> f a #

An associative binary operation