-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Lists of chunks -- -- Lists of chunks. This is similar to the Cons List provided by -- Data.List, but it is more useful as a target for a builder -- since the chunks are cache coherent. @package array-chunks @version 0.1.1.0 module Data.Chunks -- | A list of chunks. This is a foundation on top of which efficient -- builder-like abstractions can be implemented. There are no -- restrictions on the number of elements in each chunk, although -- extremely small chunks (singleton or doubleton chunks) may lead to -- poor performance. data Chunks a ChunksCons :: !SmallArray a -> !Chunks a -> Chunks a ChunksNil :: Chunks a -- | Reverse chunks but not the elements within each chunk. -- --
--   >>> reverse [[42,17,94],[6,12],[3,14]]
--   [[3,14],[6,12],[42,17,94]]
--   
reverse :: Chunks a -> Chunks a -- | Variant of reverse that allows the caller to provide an initial -- list of chunks that the reversed chunks will be pushed onto. -- --
--   >>> reverseOnto [[15],[12,4]] [[42,17,94],[6,12],[3,14]]
--   [[3,14],[6,12],[42,17,94],[15],[12,4]]
--   
reverseOnto :: Chunks a -> Chunks a -> Chunks a -- | Copy the contents of the chunks into a mutable array. Precondition: -- The destination must have enough space to house the contents. This is -- not checked. -- --
--   dest (before): [x,x,x,x,x,x,x,x,x,x,x,x]
--   copy dest 2 [[X,Y,Z],[A,B],[C,D]] (returns 9)
--   dest (after):  [x,x,X,Y,Z,A,B,C,D,x,x,x]
--   
copy :: SmallMutableArray s a -> Int -> Chunks a -> ST s Int -- | Copy the contents of the chunks into a mutable array, reversing the -- order of the chunks. Precondition: The destination must have enough -- space to house the contents. This is not checked. -- --
--   dest (before): [x,x,x,x,x,x,x,x,x,x,x,x]
--   copyReverse dest 10 [[X,Y,Z],[A,B],[C,D]] (returns 3)
--   dest (after):  [x,x,x,C,D,A,B,X,Y,Z,x,x]
--   
copyReverse :: SmallMutableArray s a -> Int -> Chunks a -> ST s Int concat :: Chunks a -> SmallArray a concatReverse :: Chunks a -> SmallArray a instance GHC.Show.Show a => GHC.Show.Show (Data.Chunks.Chunks a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Chunks.Chunks a) instance GHC.Exts.IsList (Data.Chunks.Chunks a) instance GHC.Base.Semigroup (Data.Chunks.Chunks a) instance GHC.Base.Monoid (Data.Chunks.Chunks a) instance Data.Foldable.Foldable Data.Chunks.Chunks