diff --git a/core/src/Streamly/Data/Array.hs b/core/src/Streamly/Data/Array.hs index 7b946f0d61..514fc47d8c 100644 --- a/core/src/Streamly/Data/Array.hs +++ b/core/src/Streamly/Data/Array.hs @@ -84,7 +84,7 @@ module Streamly.Data.Array , getIndex -- * Serialization - , pinnedSerialize + , serialize' , deserialize -- * Re-exports @@ -92,6 +92,7 @@ module Streamly.Data.Array , Serialize(..) -- * Deprecated + , pinnedSerialize , writeN -- drop new , write -- full buffer , writeLastN diff --git a/core/src/Streamly/Internal/Data/Array.hs b/core/src/Streamly/Internal/Data/Array.hs index 29143e86ca..fc455192e9 100644 --- a/core/src/Streamly/Internal/Data/Array.hs +++ b/core/src/Streamly/Internal/Data/Array.hs @@ -85,10 +85,11 @@ module Streamly.Internal.Data.Array -- * Serialization , encodeAs , serialize - , pinnedSerialize + , serialize' , deserialize -- * Deprecated + , pinnedSerialize , genSlicesFromLen , getSlicesFromLen , getIndices @@ -549,11 +550,12 @@ serialize = encodeAs Unpinned -- -- Properties: -- --- 1. Identity: @deserialize . pinnedSerialize == id@ --- 2. Encoded equivalence: @pinnedSerialize a == pinnedSerialize a@ -{-# INLINE pinnedSerialize #-} -pinnedSerialize :: Serialize a => a -> Array Word8 -pinnedSerialize = encodeAs Pinned +-- 1. Identity: @deserialize . serialize' == id@ +-- 2. Encoded equivalence: @serialize' a == serialize' a@ +{-# INLINE serialize' #-} +pinnedSerialize, serialize' :: Serialize a => a -> Array Word8 +serialize' = encodeAs Pinned +RENAME_PRIME(pinnedSerialize,serialize) -- XXX We can deserialize it like MutArray, returning the remaining slice.