-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A fast, non-backtracking parser for the redis RESP3 protocol -- -- RESP is redis' serialization protocol. This package provides a -- lightweight and correct parser for RESP3, which can be used -- incrementally (eg. over a network connection). @package resp @version 1.0.0 module Data.RESP -- | Top-level resp reply. Cannot be nested. data RespReply RespPush :: !ByteString -> ![RespExpr] -> RespReply RespExpr :: !RespExpr -> RespReply -- | RESP3 Expression. -- -- This descriminates the difference between RespString and RespBlob, -- even though both contain bytestrings, in order to not throw away -- information. A caller might care whether the response was delivered -- with "+", or "$". -- -- We do not, however descriminate between the different encodings of -- null. As far as I can tell, these are considered a mistake in the -- previous versions of the RESP spec, and clients should treat the -- different encodings the same. -- -- Why don't we parse RespString into Text? Well, the -- caller might not actually need to decode it into text, and so we let -- the caller decide. This way, we don't have to deal with encoding -- errors. -- -- Similarly, we don't parse a RespMap into a HashMap, -- because that would involve imposing our choice of data structure on -- the caller. They might want to use HashMap, Map, or -- just use the lookup function. -- -- Given these choices, our purview is simple: Parse the text protocol -- into a Haskell datatype, maintaining all useful information, and not -- imposing our taste onto the caller. data RespExpr RespString :: !ByteString -> RespExpr RespBlob :: !ByteString -> RespExpr RespStreamingBlob :: !LazyByteString -> RespExpr RespStringError :: !ByteString -> RespExpr RespBlobError :: !ByteString -> RespExpr RespArray :: ![RespExpr] -> RespExpr RespInteger :: !Int64 -> RespExpr RespNull :: RespExpr RespBool :: !Bool -> RespExpr RespDouble :: !Double -> RespExpr RespVerbatimString :: !ByteString -> RespExpr RespVerbatimMarkdown :: !ByteString -> RespExpr RespBigInteger :: !Integer -> RespExpr RespMap :: ![(RespExpr, RespExpr)] -> RespExpr RespSet :: ![RespExpr] -> RespExpr RespAttribute :: ![(RespExpr, RespExpr)] -> RespExpr -> RespExpr parseReply :: Scanner RespReply parseExpression :: Scanner RespExpr instance GHC.Generics.Generic Data.RESP.RespExpr instance GHC.Classes.Ord Data.RESP.RespExpr instance GHC.Classes.Eq Data.RESP.RespExpr instance GHC.Show.Show Data.RESP.RespExpr instance GHC.Generics.Generic Data.RESP.RespReply instance GHC.Classes.Ord Data.RESP.RespReply instance GHC.Classes.Eq Data.RESP.RespReply instance GHC.Show.Show Data.RESP.RespReply