Skip to content

Commit

Permalink
Rename Array.pinnedSerialize to Array.serialize'
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyaov committed Dec 9, 2024
1 parent aee485e commit 4b63d8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion core/src/Streamly/Data/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ module Streamly.Data.Array
, getIndex

-- * Serialization
, pinnedSerialize
, serialize'
, deserialize

-- * Re-exports
, Unbox (..)
, Serialize(..)

-- * Deprecated
, pinnedSerialize
, writeN -- drop new
, write -- full buffer
, writeLastN
Expand Down
14 changes: 8 additions & 6 deletions core/src/Streamly/Internal/Data/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ module Streamly.Internal.Data.Array
-- * Serialization
, encodeAs
, serialize
, pinnedSerialize
, serialize'
, deserialize

-- * Deprecated
, pinnedSerialize
, genSlicesFromLen
, getSlicesFromLen
, getIndices
Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit 4b63d8f

Please sign in to comment.