@@ -703,13 +703,12 @@ arrayChunkBytes = 1024
703703-------------------------------------------------------------------------------
704704
705705-- XXX We can possibly use a smallMutableByteArray to hold the start, end,
706−-- bound pointers. Or we can use the first 16 bytes of the allocation to store
707−-- the end, bound pointers. Using fully mutable handle will ensure that we do
708−-- not have multiple references to the same array of different lengths lying
709−-- around and potentially misused. In that case "snoc" need not return a new
710−-- array (snoc :: Array a -> a -> m ()), it will just modify the old reference.
711−-- The array length will be mutable. This means the length function would also
712−-- be monadic. Mutable arrays would behave more like files that grow in that
706+-- bound pointers. Using fully mutable handle will ensure that we do not have
707+-- multiple references to the same array of different lengths lying around and
708+-- potentially misused. In that case "snoc" need not return a new array (snoc
709+-- :: Array a -> a -> m ()), it will just modify the old reference. The array
710+-- length will be mutable. This means the length function would also be
711+-- monadic. Mutable arrays would behave more like files that grow in that
713712-- case.
714713
715714-- | Snoc using a 'Ptr'. Low level reusable function.
@@ -846,6 +845,9 @@ snoc = snocWith (* 2)
846845-- Resizing
847846-------------------------------------------------------------------------------
848847
848+-- XXX See if resizing can be implemented by reading the old array as a stream
849+-- and then using writeN to the new array.
850+--
849851-- | Reallocate the array to the specified size in bytes. If the size is less
850852-- than the original array the array gets truncated.
851853{-# NOINLINE reallocAligned #-}
@@ -925,6 +927,8 @@ rightSize arr@Array{..} = do
925927-- Reducing the length
926928-------------------------------------------------------------------------------
927929
930+-- XXX Either slice the array or stream it and write it out to a new array?
931+--
928932-- | Drop the last n elements of the array to reduce the length by n. The
929933-- capacity is reallocated using the user supplied function.
930934--