You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something that is nice about having MonadGet and MonadPut as classes is you can use the same serialization logic for different purposes. For instance, you can create a MonadPut instance based on a cryptographic hash accumulator, and now your serialization code for your type doubles for creating hashes. Maybe a bit ad hoc, but it works great!
Here are a couple other ideas for instances:
A compressing MonadPut and MonadGet. So you write and read from it as normal, but it's doing incremental compression and decompression. Perhaps you can get the same thing serializing to a lazy bytestring, then compressing that, but it's probably faster to just have the instances do this directly.
An encrypting MonadPut and MonadGet. Again, you read and write as normal, but it's encrypting / decrypting as you go.
Not sure if you'd want include any of these in this package, but just wanted to get your thoughts. Maybe such instances belong in a separate package that depends on bytes?
The text was updated successfully, but these errors were encountered:
Something that is nice about having
MonadGet
andMonadPut
as classes is you can use the same serialization logic for different purposes. For instance, you can create aMonadPut
instance based on a cryptographic hash accumulator, and now your serialization code for your type doubles for creating hashes. Maybe a bit ad hoc, but it works great!Here are a couple other ideas for instances:
MonadPut
andMonadGet
. So you write and read from it as normal, but it's doing incremental compression and decompression. Perhaps you can get the same thing serializing to a lazy bytestring, then compressing that, but it's probably faster to just have the instances do this directly.MonadPut
andMonadGet
. Again, you read and write as normal, but it's encrypting / decrypting as you go.Not sure if you'd want include any of these in this package, but just wanted to get your thoughts. Maybe such instances belong in a separate package that depends on bytes?
The text was updated successfully, but these errors were encountered: