Skip to content

Commit c86a7e8

Browse files
committed
Merge pull request #90: Document mutable-copy's arguments
2 parents fdaffc2 + 451be18 commit c86a7e8

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

Data/Vector/Generic/Mutable.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,9 @@ set = basicSet
769769

770770
-- | Copy a vector. The two vectors must have the same length and may not
771771
-- overlap.
772-
copy :: (PrimMonad m, MVector v a)
773-
=> v (PrimState m) a -> v (PrimState m) a -> m ()
772+
copy :: (PrimMonad m, MVector v a) => v (PrimState m) a -- ^ target
773+
-> v (PrimState m) a -- ^ source
774+
-> m ()
774775
{-# INLINE copy #-}
775776
copy dst src = BOUNDS_CHECK(check) "copy" "overlapping vectors"
776777
(not (dst `overlaps` src))

Data/Vector/Primitive/Mutable.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ set = G.set
318318
-- | Copy a vector. The two vectors must have the same length and may not
319319
-- overlap.
320320
copy :: (PrimMonad m, Prim a)
321-
=> MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
321+
=> MVector (PrimState m) a -- ^ target
322+
-> MVector (PrimState m) a -- ^ source
323+
-> m ()
322324
{-# INLINE copy #-}
323325
copy = G.copy
324326

Data/Vector/Storable/Mutable.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ set = G.set
421421
-- | Copy a vector. The two vectors must have the same length and may not
422422
-- overlap.
423423
copy :: (PrimMonad m, Storable a)
424-
=> MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
424+
=> MVector (PrimState m) a -- ^ target
425+
-> MVector (PrimState m) a -- ^ source
426+
-> m ()
425427
{-# INLINE copy #-}
426428
copy = G.copy
427429

Data/Vector/Unboxed/Mutable.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ set = G.set
256256
-- | Copy a vector. The two vectors must have the same length and may not
257257
-- overlap.
258258
copy :: (PrimMonad m, Unbox a)
259-
=> MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
259+
=> MVector (PrimState m) a -- ^ target
260+
-> MVector (PrimState m) a -- ^ source
261+
-> m ()
260262
{-# INLINE copy #-}
261263
copy = G.copy
262264

0 commit comments

Comments
 (0)