composewell / streamly

High performance, concurrent functional programming abstractions
https://streamly.composewell.com
Other
864 stars 66 forks source link

Add monads for hiding serialization/deserialization state #2550

Open harendra-kumar opened 1 year ago

harendra-kumar commented 1 year ago

For the Unbox type class we have Peeker monad. It could use the Array or MutArray type instead of BoundedPtr. Similarly, we can write a Poker monad which can use the MutArray type.

Similarly, we can write Serializer, Deserializer or Get/Put monads for the Serialize type class based serializations. And they can use Array and MutArray type similar to the Unbox type class.

For correcting the signature of deserializeAt, we can rename serialize/deserialize to putAt/getAt.