on master help sign in
Add a developer note in the Serialize module
c669d5eAdithya Kumar
core/src/Streamly/Internal/Data/Serialize.hs+13
@@ -42,6 +42,19 @@ import qualified Streamly.Internal.Data.Array as Array
42
42
43import GHC.Exts
43import GHC.Exts
44
44
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+
45--------------------------------------------------------------------------------
58--------------------------------------------------------------------------------
46-- Types
59-- Types
47--------------------------------------------------------------------------------
60--------------------------------------------------------------------------------