bencoding-0.4.5.0: A library for encoding and decoding of BEncode data.

Copyright(c) Sam Truzjan 2013
LicenseBSD3
Maintainerpxqr.sta@gmail.com
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.BEncode.Types

Contents

Description

Types for working with bencode data.

Synopsis

Types

type BInteger = Integer Source #

A bencode "integer".

type BString = ByteString Source #

A raw bencode string.

type BList = [BValue] Source #

A plain bencode list.

type BDict = BDictMap BValue Source #

A bencode dictionary.

data BValue Source #

BValue is straightforward ADT for b-encoded values. Please note that since dictionaries are sorted, in most cases we can compare BEncoded values without serialization and vice versa. Lists is not required to be sorted through.

Constructors

BInteger !BInteger

bencode integers;

BString !BString

bencode strings;

BList BList

list of bencode values;

BDict BDict

bencode key-value dictionary.

Instances
Eq BValue Source # 
Instance details

Defined in Data.BEncode.Types

Methods

(==) :: BValue -> BValue -> Bool #

(/=) :: BValue -> BValue -> Bool #

Ord BValue Source # 
Instance details

Defined in Data.BEncode.Types

Read BValue Source # 
Instance details

Defined in Data.BEncode.Types

Show BValue Source # 
Instance details

Defined in Data.BEncode.Types

Generic BValue Source # 
Instance details

Defined in Data.BEncode.Types

Associated Types

type Rep BValue :: Type -> Type #

Methods

from :: BValue -> Rep BValue x #

to :: Rep BValue x -> BValue #

NFData BValue Source # 
Instance details

Defined in Data.BEncode.Types

Methods

rnf :: BValue -> () #

BEncode BValue Source # 
Instance details

Defined in Data.BEncode

BEncode BDict Source # 
Instance details

Defined in Data.BEncode

type Rep BValue Source # 
Instance details

Defined in Data.BEncode.Types

Predicates

isInteger :: BValue -> Bool Source #

Test if bencoded value is an integer.

isString :: BValue -> Bool Source #

Test if bencoded value is a string, both raw and utf8 encoded.

isList :: BValue -> Bool Source #

Test if bencoded value is a list.

isDict :: BValue -> Bool Source #

Test if bencoded value is a dictionary.