bond-haskell-0.1.1.0: Runtime support for BOND serialization

Safe HaskellNone
LanguageHaskell2010

Data.Bond.Internal.Imports

Synopsis

Documentation

class BondType a => BondStruct a where Source

Bond top-level structure, can be de/serialized on its own.

Methods

bondStructGetUntagged :: (Functor (ReaderM t), Monad (ReaderM t), Protocol t) => BondGet t a Source

Read all struct fields in order.

bondStructGetBase :: (Monad (ReaderM t), Protocol t) => a -> BondGet t a Source

Read base struct from stream.

bondStructGetField :: (Functor (ReaderM t), Monad (ReaderM t), Protocol t) => Ordinal -> a -> BondGet t a Source

Read field with specific ordinal.

bondStructPut :: (Monad (BondPutM t), Protocol t) => a -> BondPut t Source

Put all struct fields to stream in order.

getSchema :: Proxy a -> StructSchema Source

Obtain struct schema.

class Hashable a

The class of types that can be converted to a hash value.

Minimal implementation: hashWithSalt.

class IsString a where

Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).

Methods

fromString :: String -> a

class Protocol t where Source

Bond serialization protocol, implements all operations.

Associated Types

type ReaderM t :: * -> * Source

type WriterM t :: * -> * Source

Methods

bondPutStruct :: BondStruct a => a -> BondPut t Source

Serialize top-level struct

bondPutBaseStruct :: BondStruct a => a -> BondPut t Source

Serialize base struct

bondGetStruct :: BondStruct a => BondGet t a Source

Deserialize top-level struct

bondGetBaseStruct :: BondStruct a => BondGet t a Source

Deserialize base struct

bondPutField :: (BondType a, BondStruct b) => Proxy b -> Ordinal -> a -> BondPut t Source

bondPutDefNothingField :: (BondType a, BondStruct b) => Proxy b -> Ordinal -> Maybe a -> BondPut t Source

bondPutBool :: Bool -> BondPut t Source

bondPutUInt8 :: Word8 -> BondPut t Source

bondPutUInt16 :: Word16 -> BondPut t Source

bondPutUInt32 :: Word32 -> BondPut t Source

bondPutUInt64 :: Word64 -> BondPut t Source

bondPutInt8 :: Int8 -> BondPut t Source

bondPutInt16 :: Int16 -> BondPut t Source

bondPutInt32 :: Int32 -> BondPut t Source

bondPutInt64 :: Int64 -> BondPut t Source

bondPutFloat :: Float -> BondPut t Source

bondPutDouble :: Double -> BondPut t Source

bondPutString :: Utf8 -> BondPut t Source

bondPutWString :: Utf16 -> BondPut t Source

bondPutBlob :: Blob -> BondPut t Source

bondPutList :: BondType a => [a] -> BondPut t Source

bondPutVector :: BondType a => Vector a -> BondPut t Source

bondPutHashSet :: BondType a => HashSet a -> BondPut t Source

bondPutSet :: BondType a => Set a -> BondPut t Source

bondPutMap :: (BondType k, BondType v) => Map k v -> BondPut t Source

bondPutNullable :: BondType a => Maybe a -> BondPut t Source

bondPutBonded :: BondStruct a => Bonded a -> BondPut t Source

bondGetBool :: BondGet t Bool Source

bondGetUInt8 :: BondGet t Word8 Source

bondGetUInt16 :: BondGet t Word16 Source

bondGetUInt32 :: BondGet t Word32 Source

bondGetUInt64 :: BondGet t Word64 Source

bondGetInt8 :: BondGet t Int8 Source

bondGetInt16 :: BondGet t Int16 Source

bondGetInt32 :: BondGet t Int32 Source

bondGetInt64 :: BondGet t Int64 Source

bondGetFloat :: BondGet t Float Source

bondGetDouble :: BondGet t Double Source

bondGetString :: BondGet t Utf8 Source

bondGetWString :: BondGet t Utf16 Source

bondGetBlob :: BondGet t Blob Source

bondGetList :: BondType a => BondGet t [a] Source

bondGetVector :: BondType a => BondGet t (Vector a) Source

bondGetHashSet :: (Eq a, Hashable a, BondType a) => BondGet t (HashSet a) Source

bondGetSet :: (Ord a, BondType a) => BondGet t (Set a) Source

bondGetMap :: (Ord k, BondType k, BondType v) => BondGet t (Map k v) Source

bondGetNullable :: BondType a => BondGet t (Maybe a) Source

bondGetDefNothing :: BondType a => BondGet t (Maybe a) Source

bondGetBonded :: BondStruct a => BondGet t (Bonded a) Source

ap :: Monad m => m (a -> b) -> m a -> m b

In many situations, the liftM operations can be replaced by uses of ap, which promotes function application.

      return f `ap` x1 `ap` ... `ap` xn

is equivalent to

      liftMn f x1 x2 ... xn

asProxyTypeOf :: a -> Proxy * a -> a

asProxyTypeOf is a type-restricted version of const. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the tag of the second.

fromOrdinalList :: [Ordinal] -> OrdinalSet Source