resp-1.0.0: A fast, non-backtracking parser for the redis RESP3 protocol
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.RESP

Synopsis

Documentation

data RespReply Source #

Top-level resp reply. Cannot be nested.

Instances

Instances details
Generic RespReply Source # 
Instance details

Defined in Data.RESP

Associated Types

type Rep RespReply :: Type -> Type #

Show RespReply Source # 
Instance details

Defined in Data.RESP

Eq RespReply Source # 
Instance details

Defined in Data.RESP

Ord RespReply Source # 
Instance details

Defined in Data.RESP

type Rep RespReply Source # 
Instance details

Defined in Data.RESP

data RespExpr Source #

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.

Instances

Instances details
Generic RespExpr Source # 
Instance details

Defined in Data.RESP

Associated Types

type Rep RespExpr :: Type -> Type #

Methods

from :: RespExpr -> Rep RespExpr x #

to :: Rep RespExpr x -> RespExpr #

Show RespExpr Source # 
Instance details

Defined in Data.RESP

Eq RespExpr Source # 
Instance details

Defined in Data.RESP

Ord RespExpr Source # 
Instance details

Defined in Data.RESP

type Rep RespExpr Source # 
Instance details

Defined in Data.RESP