-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | PackStream converter for Neo4j BOLT protocol -- -- Please see the README on GitHub at -- https://github.com/zmactep/packstream#readme @package packstream @version 0.1.0.1 module Data.PackStream.Internal.Code -- | Checks whether the represented data is () isNull :: Word8 -> Bool isFalse :: Word8 -> Bool isTrue :: Word8 -> Bool -- | Checks whether the represented data is Bool isBool :: Word8 -> Bool isTinyInt :: Word8 -> Bool isInt8 :: Word8 -> Bool isInt16 :: Word8 -> Bool isInt32 :: Word8 -> Bool isInt64 :: Word8 -> Bool -- | Checks whether the represented data is Int isInt :: Word8 -> Bool -- | Checks whether the represented data is Double isFloat :: Word8 -> Bool isBytes8 :: Word8 -> Bool isBytes16 :: Word8 -> Bool isBytes32 :: Word8 -> Bool -- | Checks whether the represented data is ByteString isBytes :: Word8 -> Bool isTinyString :: Word8 -> Bool isString8 :: Word8 -> Bool isString16 :: Word8 -> Bool isString32 :: Word8 -> Bool -- | Checks whether the represented data is Text isString :: Word8 -> Bool isTinyList :: Word8 -> Bool isList8 :: Word8 -> Bool isList16 :: Word8 -> Bool isList32 :: Word8 -> Bool -- | Checks whether the represented data is '[Value]' isList :: Word8 -> Bool isTinyDict :: Word8 -> Bool isDict8 :: Word8 -> Bool isDict16 :: Word8 -> Bool isDict32 :: Word8 -> Bool -- | Checks whether the represented data is 'Map Text Value' isDict :: Word8 -> Bool -- | Checks whether the represented data is Structure isStructure :: Word8 -> Bool -- | Extracts the size of tiny collection (Text, '[Value]' or 'Map -- Text Value') tinySize :: Word8 -> Int -- | Gets the collection of predicates and checks whether any is -- True on some data isSmth :: (Foldable t, Functor t) => t (b -> Bool) -> b -> Bool nullCode :: Word8 falseCode :: Word8 trueCode :: Word8 int8Code :: Word8 int16Code :: Word8 int32Code :: Word8 int64Code :: Word8 floatCode :: Word8 bytes8Code :: Word8 bytes16Code :: Word8 bytes32Code :: Word8 stringTinyCode :: Word8 string8Code :: Word8 string16Code :: Word8 string32Code :: Word8 listTinyCode :: Word8 list8Code :: Word8 list16Code :: Word8 list32Code :: Word8 dictTinyCode :: Word8 dict8Code :: Word8 dict16Code :: Word8 dict32Code :: Word8 structureCode :: Word8 module Data.PackStream.Internal.Hex -- | Convert strings into hexadecimal and back. class Hex t -- | Convert string into hexadecimal. hex :: Hex t => t -> t -- | Convert from hexadecimal and fail on invalid input. unhex :: (Hex t, MonadFail m) => t -> m t instance Data.PackStream.Internal.Hex.Hex GHC.Base.String instance Data.PackStream.Internal.Hex.Hex Data.ByteString.Internal.ByteString instance Data.PackStream.Internal.Hex.Hex Data.ByteString.Lazy.Internal.ByteString module Data.PackStream.Internal.Type -- | Basic PackStream error type that is used to handle parsing -- errors. data PackStreamError -- | This ByteString doesn't represent null object NotNull :: PackStreamError -- | This ByteString doesn't represent any boolean NotBool :: PackStreamError -- | This ByteString doesn't represent any unsigned integer NotWord :: PackStreamError -- | This ByteString doesn't represent any integer NotInt :: PackStreamError -- | This ByteString doesn't represent any floating-point number NotFloat :: PackStreamError -- | This ByteString doesn't represent any Text string NotString :: PackStreamError -- | This ByteString doesn't represent any ByteString array NotBytes :: PackStreamError -- | This ByteString doesn't represent any list of PackStream -- values NotList :: PackStreamError -- | This ByteString doesn't represent any dictionary of -- PackStream values NotDict :: PackStreamError -- | This ByteString doesn't represent any Structure NotStructure :: PackStreamError -- | This ByteString doesn't represent any Value NotValue :: PackStreamError -- | This ByteString doesn't represent specific Structure WrongStructure :: Text -> PackStreamError -- | Basic parser type. It works like parser combinators for binary data -- that represents PackStream. newtype PackStream a PackStream :: ExceptT PackStreamError (State ByteString) a -> PackStream a [runUnpackS] :: PackStream a -> ExceptT PackStreamError (State ByteString) a -- | Use specific parser combinator to parse the ByteString that -- represents any PackStream data. unpackStream :: PackStream a -> ByteString -> Either PackStreamError a -- | PackStream offers a number of core data types, many supported by -- multiple binary representations, as well as a flexible extension -- mechanism. data Value -- | Missing or empty value N :: Value -- | True or False B :: Bool -> Value -- | Signed 64-bit integer I :: Int -> Value -- | 64-bit floating point number F :: Double -> Value -- | Byte array U :: ByteString -> Value -- | Unicode text, UTF-8 T :: Text -> Value -- | Ordered collection of Values L :: [Value] -> Value -- | Collection of key-value entries (no order guaranteed) D :: Map Text Value -> Value -- | Composite value with a type signature S :: Structure -> Value -- | A structure is a composite value, comprised of fields and a unique -- type code. Structure encodings consist, beyond the marker, of a single -- byte, the tag byte, followed by a sequence of up to 15 fields, each an -- individual value. The size of a structure is measured as the number of -- fields and not the total byte size. This count does not include the -- tag. data Structure Structure :: Word8 -> [Value] -> Structure -- | Type code [signature] :: Structure -> Word8 -- | Structure fields [fields] :: Structure -> [Value] -- | The data types that can be serialized as PackStream class ToValue a -- | Convert data type to the generic Value toValue :: ToValue a => a -> Value -- | Represent a Text key and some ToValue data into the -- Map pair. Can be useful to work with PackStream -- dictionaries. -- --
--   fromList ["hello" =: 1, "world" =: False]
--   
(=:) :: ToValue a => Text -> a -> (Text, Value) -- | The data types taht can be read from PackStream representation class FromValue a -- | Converts generic Value type to a specific one or raises -- PackStreamError fromValue :: FromValue a => Value -> Either PackStreamError a instance GHC.Classes.Ord Data.PackStream.Internal.Type.PackStreamError instance GHC.Classes.Eq Data.PackStream.Internal.Type.PackStreamError instance GHC.Show.Show Data.PackStream.Internal.Type.PackStreamError instance Control.Monad.Error.Class.MonadError Data.PackStream.Internal.Type.PackStreamError Data.PackStream.Internal.Type.PackStream instance Control.Monad.State.Class.MonadState Data.ByteString.Internal.ByteString Data.PackStream.Internal.Type.PackStream instance GHC.Base.Monad Data.PackStream.Internal.Type.PackStream instance GHC.Base.Applicative Data.PackStream.Internal.Type.PackStream instance GHC.Base.Functor Data.PackStream.Internal.Type.PackStream instance GHC.Classes.Eq Data.PackStream.Internal.Type.Value instance GHC.Show.Show Data.PackStream.Internal.Type.Value instance GHC.Classes.Eq Data.PackStream.Internal.Type.Structure instance GHC.Show.Show Data.PackStream.Internal.Type.Structure instance Data.PackStream.Internal.Type.FromValue () instance Data.PackStream.Internal.Type.FromValue GHC.Types.Bool instance Data.PackStream.Internal.Type.FromValue GHC.Types.Int instance Data.PackStream.Internal.Type.FromValue GHC.Integer.Type.Integer instance Data.PackStream.Internal.Type.FromValue GHC.Types.Double instance Data.PackStream.Internal.Type.FromValue Data.ByteString.Internal.ByteString instance Data.PackStream.Internal.Type.FromValue Data.Text.Internal.Text instance Data.PackStream.Internal.Type.FromValue a => Data.PackStream.Internal.Type.FromValue [a] instance Data.PackStream.Internal.Type.FromValue a => Data.PackStream.Internal.Type.FromValue (Data.Map.Internal.Map Data.Text.Internal.Text a) instance Data.PackStream.Internal.Type.FromValue Data.PackStream.Internal.Type.Structure instance Data.PackStream.Internal.Type.FromValue Data.PackStream.Internal.Type.Value instance Data.PackStream.Internal.Type.ToValue () instance Data.PackStream.Internal.Type.ToValue GHC.Types.Bool instance Data.PackStream.Internal.Type.ToValue GHC.Types.Int instance Data.PackStream.Internal.Type.ToValue GHC.Integer.Type.Integer instance Data.PackStream.Internal.Type.ToValue GHC.Types.Double instance Data.PackStream.Internal.Type.ToValue Data.ByteString.Internal.ByteString instance Data.PackStream.Internal.Type.ToValue Data.Text.Internal.Text instance Data.PackStream.Internal.Type.ToValue a => Data.PackStream.Internal.Type.ToValue [a] instance Data.PackStream.Internal.Type.ToValue a => Data.PackStream.Internal.Type.ToValue (Data.Map.Internal.Map Data.Text.Internal.Text a) instance Data.PackStream.Internal.Type.ToValue Data.PackStream.Internal.Type.Structure instance Data.PackStream.Internal.Type.ToValue Data.PackStream.Internal.Type.Value module Data.PackStream.Internal.Binary -- | The data types that can be intepreted from ByteString class Interpret a -- | Interpret a ByteString as a specific type of raise -- PackStreamError interpret :: (Interpret a, MonadError PackStreamError m) => ByteString -> m a -- | Interpret a ByteString as a specific type of raise -- PackStreamError interpret :: (Interpret a, MonadError PackStreamError m, Binary a) => ByteString -> m a -- | The data types that can be serialized into ByteString class Serialize a -- | Serialize a specific data type into a ByteString serialize :: Serialize a => a -> ByteString -- | Serialize a specific data type into a ByteString serialize :: (Serialize a, Binary a) => a -> ByteString -- | Check that the Integral value is in the n-bit bounds inDepth :: Integral a => Int -> a -> Bool instance Data.PackStream.Internal.Binary.Serialize GHC.Int.Int8 instance Data.PackStream.Internal.Binary.Serialize GHC.Int.Int16 instance Data.PackStream.Internal.Binary.Serialize GHC.Int.Int32 instance Data.PackStream.Internal.Binary.Serialize GHC.Int.Int64 instance Data.PackStream.Internal.Binary.Serialize GHC.Word.Word8 instance Data.PackStream.Internal.Binary.Serialize GHC.Word.Word16 instance Data.PackStream.Internal.Binary.Serialize GHC.Word.Word32 instance Data.PackStream.Internal.Binary.Serialize GHC.Word.Word64 instance Data.PackStream.Internal.Binary.Serialize GHC.Types.Word instance Data.PackStream.Internal.Binary.Serialize GHC.Types.Int instance Data.PackStream.Internal.Binary.Serialize GHC.Integer.Type.Integer instance Data.PackStream.Internal.Binary.Serialize GHC.Types.Double instance Data.PackStream.Internal.Binary.Serialize Data.ByteString.Internal.ByteString instance Data.PackStream.Internal.Binary.Serialize Data.Text.Internal.Text instance Data.PackStream.Internal.Binary.Interpret GHC.Int.Int8 instance Data.PackStream.Internal.Binary.Interpret GHC.Int.Int16 instance Data.PackStream.Internal.Binary.Interpret GHC.Int.Int32 instance Data.PackStream.Internal.Binary.Interpret GHC.Int.Int64 instance Data.PackStream.Internal.Binary.Interpret GHC.Word.Word8 instance Data.PackStream.Internal.Binary.Interpret GHC.Word.Word16 instance Data.PackStream.Internal.Binary.Interpret GHC.Word.Word32 instance Data.PackStream.Internal.Binary.Interpret GHC.Word.Word64 instance Data.PackStream.Internal.Binary.Interpret GHC.Types.Word instance Data.PackStream.Internal.Binary.Interpret GHC.Types.Int instance Data.PackStream.Internal.Binary.Interpret GHC.Integer.Type.Integer instance Data.PackStream.Internal.Binary.Interpret GHC.Types.Double instance Data.PackStream.Internal.Binary.Interpret Data.ByteString.Internal.ByteString instance Data.PackStream.Internal.Binary.Interpret Data.Text.Internal.Text module Data.PackStream.Parser -- | Parse () null :: PackStream () -- | Parse Bool bool :: PackStream Bool -- | Parse Int integer :: PackStream Int -- | Parse Double float :: PackStream Double -- | Parse ByteString bytes :: PackStream ByteString -- | Parse Text string :: PackStream Text -- | Parse a list of specified Values (e.g. `list integer` will -- parse some '[Int]') list :: PackStream a -> PackStream [a] -- | Parse a dictionary of specified Values (e.g. `dict integer` -- will parse some 'Map Text Int') dict :: forall a. PackStream a -> PackStream (Map Text a) -- | Parse Structure structure :: PackStream Structure -- | Parse any valid Value value :: PackStream Value module Data.PackStream.Serializer -- | Represent () as PackStream ByteString null :: ByteString -- | Represent Bool as PackStream ByteString bool :: Bool -> ByteString -- | Represent Int as PackStream ByteString integer :: Int -> ByteString -- | Represent Double as PackStream ByteString float :: Double -> ByteString -- | Represent ByteString as PackStream ByteString bytes :: ByteString -> ByteString -- | Represent Text as PackStream ByteString string :: Text -> ByteString -- | Represent '[Value]' as PackStream ByteString list :: [Value] -> ByteString -- | Represent 'Map Text Value' as PackStream ByteString dict :: Map Text Value -> ByteString -- | Represent Structure as PackStream ByteString structure :: Structure -> ByteString -- | Represent Value as PackStream ByteString value :: Value -> ByteString module Data.PackStream -- | Basic PackStream error type that is used to handle parsing -- errors. data PackStreamError -- | This ByteString doesn't represent null object NotNull :: PackStreamError -- | This ByteString doesn't represent any boolean NotBool :: PackStreamError -- | This ByteString doesn't represent any unsigned integer NotWord :: PackStreamError -- | This ByteString doesn't represent any integer NotInt :: PackStreamError -- | This ByteString doesn't represent any floating-point number NotFloat :: PackStreamError -- | This ByteString doesn't represent any Text string NotString :: PackStreamError -- | This ByteString doesn't represent any ByteString array NotBytes :: PackStreamError -- | This ByteString doesn't represent any list of PackStream -- values NotList :: PackStreamError -- | This ByteString doesn't represent any dictionary of -- PackStream values NotDict :: PackStreamError -- | This ByteString doesn't represent any Structure NotStructure :: PackStreamError -- | This ByteString doesn't represent any Value NotValue :: PackStreamError -- | This ByteString doesn't represent specific Structure WrongStructure :: Text -> PackStreamError -- | Basic parser type. It works like parser combinators for binary data -- that represents PackStream. newtype PackStream a PackStream :: ExceptT PackStreamError (State ByteString) a -> PackStream a [runUnpackS] :: PackStream a -> ExceptT PackStreamError (State ByteString) a -- | The data types that can be interpreted or parsed to/from -- PackStream ByteString class PackStreamValue a -- | Pack a value into a PackStream ByteString pack :: PackStreamValue a => a -> ByteString -- | Parse a value from a PackStream ByteString unpack :: PackStreamValue a => PackStream a -- | Use specific parser combinator to parse the ByteString that -- represents any PackStream data. unpackStream :: PackStream a -> ByteString -> Either PackStreamError a -- | Unpack some value of the specific type from ByteString or -- fail unpackFail :: (MonadFail m, PackStreamValue a) => ByteString -> m a -- | Unpack some value of the specific type from ByteString or raise -- PackStreamError unpackThrow :: (MonadError PackStreamError m, PackStreamValue a) => ByteString -> m a -- | PackStream offers a number of core data types, many supported by -- multiple binary representations, as well as a flexible extension -- mechanism. data Value -- | Missing or empty value N :: Value -- | True or False B :: Bool -> Value -- | Signed 64-bit integer I :: Int -> Value -- | 64-bit floating point number F :: Double -> Value -- | Byte array U :: ByteString -> Value -- | Unicode text, UTF-8 T :: Text -> Value -- | Ordered collection of Values L :: [Value] -> Value -- | Collection of key-value entries (no order guaranteed) D :: Map Text Value -> Value -- | Composite value with a type signature S :: Structure -> Value -- | Represent a Text key and some ToValue data into the -- Map pair. Can be useful to work with PackStream -- dictionaries. -- --
--   fromList ["hello" =: 1, "world" =: False]
--   
(=:) :: ToValue a => Text -> a -> (Text, Value) -- | A structure is a composite value, comprised of fields and a unique -- type code. Structure encodings consist, beyond the marker, of a single -- byte, the tag byte, followed by a sequence of up to 15 fields, each an -- individual value. The size of a structure is measured as the number of -- fields and not the total byte size. This count does not include the -- tag. data Structure Structure :: Word8 -> [Value] -> Structure -- | Type code [signature] :: Structure -> Word8 -- | Structure fields [fields] :: Structure -> [Value] instance Data.PackStream.PackStreamValue () instance Data.PackStream.PackStreamValue GHC.Types.Bool instance Data.PackStream.PackStreamValue GHC.Types.Int instance Data.PackStream.PackStreamValue GHC.Integer.Type.Integer instance Data.PackStream.PackStreamValue GHC.Types.Double instance Data.PackStream.PackStreamValue Data.ByteString.Internal.ByteString instance Data.PackStream.PackStreamValue Data.Text.Internal.Text instance (Data.PackStream.Internal.Type.ToValue a, Data.PackStream.PackStreamValue a) => Data.PackStream.PackStreamValue [a] instance (Data.PackStream.Internal.Type.ToValue a, Data.PackStream.PackStreamValue a) => Data.PackStream.PackStreamValue (Data.Map.Internal.Map Data.Text.Internal.Text a) instance Data.PackStream.PackStreamValue Data.PackStream.Internal.Type.Structure instance Data.PackStream.PackStreamValue Data.PackStream.Internal.Type.Value module Data.PackStream.Structure -- | The set of types, that can be presented as PackStream -- Structures class ToStructure a -- | Convert object to Structure toStructure :: ToStructure a => a -> Structure -- | The set of types, that can be parsed from PackStream -- Structures class FromStructure a -- | Convert Structure to the object of selected type fromStructure :: FromStructure a => Structure -> Either PackStreamError a -- | Snapshot of a node within a graph database data Node Node :: Int -> [Text] -> Map Text Value -> Node -- | Node identifier [nodeId] :: Node -> Int -- | List of node labels [labels] :: Node -> [Text] -- | Dict of node properties [nodeProps] :: Node -> Map Text Value -- | Snapshot of a relationship within a graph database data Relationship Relationship :: Int -> Int -> Int -> Text -> Map Text Value -> Relationship -- | Relationship identifier [relId] :: Relationship -> Int -- | Identifier of the start node [startNodeId] :: Relationship -> Int -- | Identifier of the end node [endNodeId] :: Relationship -> Int -- | Relationship type [relType] :: Relationship -> Text -- | Dict of relationship properties [relProps] :: Relationship -> Map Text Value -- | Relationship detail without start or end node information data UnboundRelationship UnboundRelationship :: Int -> Text -> Map Text Value -> UnboundRelationship -- | Relationship identifier [urelId] :: UnboundRelationship -> Int -- | Relationship type [urelType] :: UnboundRelationship -> Text -- | Dict of relationship properties [urelProps] :: UnboundRelationship -> Map Text Value -- | Alternating sequence of nodes and relationships data Path Path :: [Node] -> [UnboundRelationship] -> [Int] -> Path -- | Chain of Nodes in path [nodes] :: Path -> [Node] -- | Chain of UnboundRelationships in path [rels] :: Path -> [UnboundRelationship] -- | The ids is a list of relationship id and node id to represent the path [ids] :: Path -> [Int] instance GHC.Classes.Eq Data.PackStream.Structure.Node instance GHC.Show.Show Data.PackStream.Structure.Node instance GHC.Classes.Eq Data.PackStream.Structure.Relationship instance GHC.Show.Show Data.PackStream.Structure.Relationship instance GHC.Classes.Eq Data.PackStream.Structure.UnboundRelationship instance GHC.Show.Show Data.PackStream.Structure.UnboundRelationship instance GHC.Classes.Eq Data.PackStream.Structure.Path instance GHC.Show.Show Data.PackStream.Structure.Path instance GHC.Classes.Eq Data.PackStream.Structure.Date instance GHC.Show.Show Data.PackStream.Structure.Date instance Data.PackStream.Structure.ToStructure Data.PackStream.Structure.Date instance Data.PackStream.Structure.FromStructure Data.PackStream.Structure.Date instance Data.PackStream.Structure.ToStructure Data.PackStream.Structure.Path instance Data.PackStream.Structure.FromStructure Data.PackStream.Structure.Path instance Data.PackStream.Structure.ToStructure Data.PackStream.Structure.UnboundRelationship instance Data.PackStream.Structure.FromStructure Data.PackStream.Structure.UnboundRelationship instance Data.PackStream.Structure.ToStructure Data.PackStream.Structure.Relationship instance Data.PackStream.Structure.FromStructure Data.PackStream.Structure.Relationship instance Data.PackStream.Structure.ToStructure Data.PackStream.Structure.Node instance Data.PackStream.Structure.FromStructure Data.PackStream.Structure.Node