Skip to content

Commit b69d7ad

Browse files
committed
Document which of mutable-copy's argument is the target, and which is the source
1 parent e000d6c commit b69d7ad

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
@@ -768,8 +768,9 @@ set = basicSet
768768

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

Data/Vector/Primitive/Mutable.hs

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

Data/Vector/Storable/Mutable.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ set = G.set
401401
-- | Copy a vector. The two vectors must have the same length and may not
402402
-- overlap.
403403
copy :: (PrimMonad m, Storable a)
404-
=> MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
404+
=> MVector (PrimState m) a -- ^ target
405+
-> MVector (PrimState m) a -- ^ source
406+
-> m ()
405407
{-# INLINE copy #-}
406408
copy = G.copy
407409

Data/Vector/Unboxed/Mutable.hs

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

0 commit comments

Comments
 (0)