hasbolt-0.1.4.4: Haskell driver for Neo4j 3+ (BOLT protocol)
Safe HaskellNone
LanguageHaskell2010

Database.Bolt.Serialization

Synopsis

Documentation

class BoltValue a where Source #

The BoltValue class describes values, that can be packed and unpacked for BOLT protocol.

Methods

pack :: a -> ByteString Source #

Packs a value to ByteString

unpackT :: Monad m => UnpackT m a Source #

Unpacks in a State monad to get values from single ByteString

Instances

Instances details
BoltValue Bool Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Bool -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m Bool Source #

BoltValue Double Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Double -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m Double Source #

BoltValue Int Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Int -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m Int Source #

BoltValue () Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: () -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m () Source #

BoltValue Text Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Text -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m Text Source #

BoltValue Value Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Value -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m Value Source #

BoltValue Structure Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Structure -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m Structure Source #

BoltValue a => BoltValue [a] Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: [a] -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m [a] Source #

BoltValue a => BoltValue (Map Text a) Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Map Text a -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m (Map Text a) Source #

data UnpackT m a Source #

The UnpackT transformer helps to unpack a set of values from one ByteString

Instances

Instances details
Monad m => MonadState ByteString (UnpackT m) Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

get :: UnpackT m ByteString #

put :: ByteString -> UnpackT m () #

state :: (ByteString -> (a, ByteString)) -> UnpackT m a #

Monad m => MonadError UnpackError (UnpackT m) Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

throwError :: UnpackError -> UnpackT m a #

catchError :: UnpackT m a -> (UnpackError -> UnpackT m a) -> UnpackT m a #

Monad m => Monad (UnpackT m) Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

(>>=) :: UnpackT m a -> (a -> UnpackT m b) -> UnpackT m b #

(>>) :: UnpackT m a -> UnpackT m b -> UnpackT m b #

return :: a -> UnpackT m a #

Functor m => Functor (UnpackT m) Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

fmap :: (a -> b) -> UnpackT m a -> UnpackT m b #

(<$) :: a -> UnpackT m b -> UnpackT m a #

Monad m => Applicative (UnpackT m) Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

pure :: a -> UnpackT m a #

(<*>) :: UnpackT m (a -> b) -> UnpackT m a -> UnpackT m b #

liftA2 :: (a -> b -> c) -> UnpackT m a -> UnpackT m b -> UnpackT m c #

(*>) :: UnpackT m a -> UnpackT m b -> UnpackT m b #

(<*) :: UnpackT m a -> UnpackT m b -> UnpackT m a #

class ToStructure a where Source #

Generalizes all datatypes that can be serialized to Structures.

Methods

toStructure :: a -> Structure Source #

class FromStructure a where Source #

Generalizes all datatypes that can be deserialized from Structures.

unpack :: (Monad m, BoltValue a) => ByteString -> m (Either UnpackError a) Source #

Unpacks a ByteString to selected value

unpackF :: (MonadFail m, BoltValue a) => ByteString -> m a Source #

Old-style unpack that runs fail on error

unpackAction :: Monad m => UnpackT m a -> ByteString -> m (Either UnpackError a) Source #

Unpacks a ByteString to selected value by some custom action