on master help sign in
Add a developer note in the Serialize module
commitc669d5e627ba57569fa63d7faf739d3a7a3be284 authorAdithya Kumar <adithya@composewell.com> dateSat 9 Sep 2023, 21:23 (3 years ago) parentc36f8bb
1 file changed+13
core/src/Streamly/Internal/Data/Serialize.hs+13
core/src/Streamly/Internal/Data/Serialize.hs+13
@@ -42,6 +42,19 @@ import qualified Streamly.Internal.Data.Array as Array
4242
4343import GHC.Exts
4444
45+--------------------------------------------------------------------------------
46+-- Developer Note
47+--------------------------------------------------------------------------------
48+
49+-- IMPORTANT
50+-- =========
51+--
52+-- Don't ever serialize the offsets in the encoding. Serialize length instead.
53+-- Offsets are NOT stable.
54+--
55+-- They will only work if the start offset of the Array when encoding and
56+-- decoding is the same. This is almost never the case.
57+
4558--------------------------------------------------------------------------------
4659-- Types
4760--------------------------------------------------------------------------------