composewell / streamly-serialize-instances

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lazy Bytestring and Lazy Text serialization

adithyaov opened this issue · comments

  • Does it make sense to serialize these structures?
  • What is the use-case for this?

One use case I can think of is they can be serialized for rpc.
Does it make sense to send a serialized version of a Lazy.ByteString over the network?

We can serialize a list of strict bytestring, so why shouldn't we serialize a lazy bytestring (which is essentially a list of strict bytestring).

It makes sense to have serialization for lazy bytestring and lazy text.
They are basically list of bytestrings.

In favor of having them:

  • Aeson uses Lazy text.
  • We support having a list of strict variants so conceptually there is no problem in supporting serialization of lazy variants.

In conclusion, we should have serialization for lazy variants.