CBOR-0.1.0.1: Encode/Decode values to/from CBOR

Safe HaskellNone

Data.CBOR

Description

Provides functions to serialize CBOR encoded values to/from ByteStrings.

Warning, this package is very alpha quality right now. I've attempted to implement a useful subset of the CBOR standard, but the interface is still being refined and subject to change. Do not use this for anything important!

Synopsis

Documentation

data CBOR Source

Data type for CBOR values

Constructors

CBOR_UInt Integer 
CBOR_SInt Integer 
CBOR_BS ByteString 
CBOR_TS ByteString

TextString. This SHOULD be a UTF8 string if the spec is being followed.

CBOR_Array [CBOR] 
CBOR_Map [(CBOR, CBOR)] 
CBOR_Tag Integer CBOR 
CBOR_HalfFloat HalfFloat

N.B. Currently stored as an opaque value because I can't be bothered to implement my own half width float type.

CBOR_Float Float 
CBOR_Double Double 
CBOR_NULL 
CBOR_Undefined

Undefined as per the CBOR specification, a value of this type will usually represent a serializatoin error.

CBOR_Reserved Int

Reserved, you probably shouldn't see any of these.

CBOR_Unassigned Int

Unassigned

CBOR_True 
CBOR_False 
CBOR_Byte Word8 
CBOR_Stop

Stop marker for indefinite encoding scheme

Instances

newtype HalfFloat Source

Constructors

HF Word16

Opaque value, actual implementation TODO