Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class BoltValue a where
- pack :: a -> ByteString
- unpackT :: Monad m => UnpackT m a
- data UnpackT m a
- data UnpackError
- class ToStructure a where
- toStructure :: a -> Structure
- class FromStructure a where
- fromStructure :: MonadError UnpackError m => Structure -> m a
- unpack :: (Monad m, BoltValue a) => ByteString -> m (Either UnpackError a)
- unpackF :: (MonadFail m, BoltValue a) => ByteString -> m a
- unpackAction :: Monad m => UnpackT m a -> ByteString -> m (Either UnpackError a)
Documentation
class BoltValue a where Source #
The BoltValue
class describes values, that can be packed and unpacked for BOLT protocol.
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
The UnpackT
transformer helps to unpack a set of values from one ByteString
Instances
Monad m => MonadState ByteString (UnpackT m) Source # | |
Defined in Database.Bolt.Value.Type get :: UnpackT m ByteString # put :: ByteString -> UnpackT m () # state :: (ByteString -> (a, ByteString)) -> UnpackT m a # | |
Monad m => MonadError UnpackError (UnpackT m) Source # | |
Defined in Database.Bolt.Value.Type throwError :: UnpackError -> UnpackT m a # catchError :: UnpackT m a -> (UnpackError -> UnpackT m a) -> UnpackT m a # | |
Monad m => Monad (UnpackT m) Source # | |
Functor m => Functor (UnpackT m) Source # | |
Monad m => Applicative (UnpackT m) Source # | |
data UnpackError Source #
Error during unpack process
Instances
Eq UnpackError Source # | |
Defined in Database.Bolt.Value.Type (==) :: UnpackError -> UnpackError -> Bool # (/=) :: UnpackError -> UnpackError -> Bool # | |
Ord UnpackError Source # | |
Defined in Database.Bolt.Value.Type compare :: UnpackError -> UnpackError -> Ordering # (<) :: UnpackError -> UnpackError -> Bool # (<=) :: UnpackError -> UnpackError -> Bool # (>) :: UnpackError -> UnpackError -> Bool # (>=) :: UnpackError -> UnpackError -> Bool # max :: UnpackError -> UnpackError -> UnpackError # min :: UnpackError -> UnpackError -> UnpackError # | |
Show UnpackError Source # | |
Defined in Database.Bolt.Value.Type showsPrec :: Int -> UnpackError -> ShowS # show :: UnpackError -> String # showList :: [UnpackError] -> ShowS # | |
Monad m => MonadError UnpackError (UnpackT m) Source # | |
Defined in Database.Bolt.Value.Type throwError :: UnpackError -> UnpackT m a # catchError :: UnpackT m a -> (UnpackError -> UnpackT m a) -> UnpackT m a # |
class ToStructure a where Source #
Generalizes all datatypes that can be serialized to Structure
s.
toStructure :: a -> Structure Source #
class FromStructure a where Source #
Generalizes all datatypes that can be deserialized from Structure
s.
fromStructure :: MonadError UnpackError m => Structure -> m a Source #
Instances
FromStructure Path Source # | |
Defined in Database.Bolt.Value.Instances fromStructure :: MonadError UnpackError m => Structure -> m Path Source # | |
FromStructure URelationship Source # | |
Defined in Database.Bolt.Value.Instances fromStructure :: MonadError UnpackError m => Structure -> m URelationship Source # | |
FromStructure Relationship Source # | |
Defined in Database.Bolt.Value.Instances fromStructure :: MonadError UnpackError m => Structure -> m Relationship Source # | |
FromStructure Node Source # | |
Defined in Database.Bolt.Value.Instances fromStructure :: MonadError UnpackError m => Structure -> m Node Source # |
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