From 4b63d8f0e0f100e487e5cbfcceab5a37a7e31039 Mon Sep 17 00:00:00 2001 From: Adithya Kumar Date: Mon, 9 Dec 2024 18:48:05 +0530 Subject: [PATCH] Rename Array.pinnedSerialize to Array.serialize' --- core/src/Streamly/Data/Array.hs | 3 ++- core/src/Streamly/Internal/Data/Array.hs | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) 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.