@@ -132,12 +132,15 @@ module Data.Vector.Unboxed (
132132 -- ** Zipping
133133 zipWith , zipWith3 , zipWith4 , zipWith5 , zipWith6 ,
134134 izipWith , izipWith3 , izipWith4 , izipWith5 , izipWith6 ,
135+ -- *** Zipping tuples
136+ -- $zip
135137 zip , zip3 , zip4 , zip5 , zip6 ,
136138
137139 -- ** Monadic zipping
138140 zipWithM , izipWithM , zipWithM_ , izipWithM_ ,
139141
140142 -- ** Unzipping
143+ -- $unzip
141144 unzip , unzip3 , unzip4 , unzip5 , unzip6 ,
142145
143146 -- * Working with predicates
@@ -970,6 +973,26 @@ iforM_ = G.iforM_
970973-- Zipping
971974-- -------
972975
976+ -- $zip
977+ --
978+ -- Following functions could be used to construct vector of tuples
979+ -- from tuple of vectors. This operation is done in /O(1)/ time and
980+ -- will share underlying buffers.
981+ --
982+ -- Note that variants from "Data.Vector.Generic" doesn't have this
983+ -- property.
984+
985+ -- $unzip
986+ --
987+ -- Following functions could be used to access underlying
988+ -- representation of array of tuples. They convert array to tuple of
989+ -- arrays. This operation is done in /O(1)/ time and will share
990+ -- underlying buffers.
991+ --
992+ -- Note that variants from "Data.Vector.Generic" doesn't have this
993+ -- property.
994+
995+
973996-- | /O(min(m,n))/ Zip two vectors with the given function.
974997zipWith :: (Unbox a , Unbox b , Unbox c )
975998 => (a -> b -> c ) -> Vector a -> Vector b -> Vector c
0 commit comments