@@ -86,6 +86,7 @@ import Foreign.ForeignPtr (ForeignPtr)
8686import Foreign.Ptr (Ptr )
8787
8888import Control.Monad.Primitive
89+ import GHC.Stack (HasCallStack )
8990
9091import Prelude (IO , Int , Ord , Bool , Maybe , Ordering (.. ) )
9192
@@ -197,7 +198,7 @@ overlaps = G.overlaps
197198-- --------------
198199
199200-- | Create a mutable vector of the given length.
200- new :: (PrimMonad m , Storable a ) => Int -> m (MVector (PrimState m ) a )
201+ new :: (HasCallStack , PrimMonad m , Storable a ) => Int -> m (MVector (PrimState m ) a )
201202{-# INLINE new #-}
202203new = G. new
203204
@@ -284,7 +285,7 @@ clone = G.clone
284285-- [10,20,30]
285286--
286287-- @since 0.5
287- grow :: (PrimMonad m , Storable a )
288+ grow :: (HasCallStack , PrimMonad m , Storable a )
288289 => MVector (PrimState m ) a -> Int -> m (MVector (PrimState m ) a )
289290{-# INLINE grow #-}
290291grow = G. grow
@@ -319,7 +320,7 @@ clear = G.clear
319320-- >>> v <- MVS.generate 10 (\x -> x*x)
320321-- >>> MVS.read v 3
321322-- 9
322- read :: (PrimMonad m , Storable a ) => MVector (PrimState m ) a -> Int -> m a
323+ read :: (HasCallStack , PrimMonad m , Storable a ) => MVector (PrimState m ) a -> Int -> m a
323324{-# INLINE read #-}
324325read = G. read
325326
@@ -342,30 +343,30 @@ readMaybe = G.readMaybe
342343
343344-- | Replace the element at the given position.
344345write
345- :: (PrimMonad m , Storable a ) => MVector (PrimState m ) a -> Int -> a -> m ()
346+ :: (HasCallStack , PrimMonad m , Storable a ) => MVector (PrimState m ) a -> Int -> a -> m ()
346347{-# INLINE write #-}
347348write = G. write
348349
349350-- | Modify the element at the given position.
350- modify :: (PrimMonad m , Storable a ) => MVector (PrimState m ) a -> (a -> a ) -> Int -> m ()
351+ modify :: (HasCallStack , PrimMonad m , Storable a ) => MVector (PrimState m ) a -> (a -> a ) -> Int -> m ()
351352{-# INLINE modify #-}
352353modify = G. modify
353354
354355-- | Modify the element at the given position using a monadic function.
355356--
356357-- @since 0.12.3.0
357- modifyM :: (PrimMonad m , Storable a ) => MVector (PrimState m ) a -> (a -> m a ) -> Int -> m ()
358+ modifyM :: (HasCallStack , PrimMonad m , Storable a ) => MVector (PrimState m ) a -> (a -> m a ) -> Int -> m ()
358359{-# INLINE modifyM #-}
359360modifyM = G. modifyM
360361
361362-- | Swap the elements at the given positions.
362363swap
363- :: (PrimMonad m , Storable a ) => MVector (PrimState m ) a -> Int -> Int -> m ()
364+ :: (HasCallStack , PrimMonad m , Storable a ) => MVector (PrimState m ) a -> Int -> Int -> m ()
364365{-# INLINE swap #-}
365366swap = G. swap
366367
367368-- | Replace the element at the given position and return the old element.
368- exchange :: (PrimMonad m , Storable a ) => MVector (PrimState m ) a -> Int -> a -> m a
369+ exchange :: (HasCallStack , PrimMonad m , Storable a ) => MVector (PrimState m ) a -> Int -> a -> m a
369370{-# INLINE exchange #-}
370371exchange = G. exchange
371372
@@ -413,7 +414,7 @@ set = G.set
413414
414415-- | Copy a vector. The two vectors must have the same length and may not
415416-- overlap.
416- copy :: (PrimMonad m , Storable a )
417+ copy :: (HasCallStack , PrimMonad m , Storable a )
417418 => MVector (PrimState m ) a -- ^ target
418419 -> MVector (PrimState m ) a -- ^ source
419420 -> m ()
@@ -436,7 +437,7 @@ unsafeCopy = G.unsafeCopy
436437-- Otherwise, the copying is performed as if the source vector were
437438-- copied to a temporary vector and then the temporary vector was copied
438439-- to the target vector.
439- move :: (PrimMonad m , Storable a )
440+ move :: (HasCallStack , PrimMonad m , Storable a )
440441 => MVector (PrimState m ) a -- ^ target
441442 -> MVector (PrimState m ) a -- ^ source
442443 -> m ()
0 commit comments