You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move safe function and {IO,ST}Vector to safe modules
Exception:
- {IO,ST}Vector are left in D.V.Storable.Mutable.Unsafe since IOVector
is used there
- {IO,ST}Vector are left in D.V.Unsafe.Unsafe. They were previously
defined in D.V.Unsafe.Base. Now Base simply reexport Unsafe module
Copy file name to clipboardExpand all lines: vector/src/Data/Vector/Mutable/Unsafe.hs
+1-30Lines changed: 1 addition & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,13 @@
13
13
-- generally unsafe and may violate memory safety
14
14
moduleData.Vector.Mutable.Unsafe
15
15
( MVector(..)
16
-
, IOVector
17
-
, STVector
18
-
-- * Array conversions
19
-
, toMutableArray
20
-
, fromMutableArray
21
16
) where
22
17
23
-
importControl.Monad (when, liftM)
18
+
importControl.Monad (when)
24
19
importControl.Monad.ST (ST)
25
20
importqualifiedData.Vector.Generic.MutableasG
26
21
importData.Vector.Internal.Check
27
22
importData.Primitive.Array
28
-
importControl.Monad.Primitive
29
23
30
24
importPrelude
31
25
( Monad, Ordering(..), Int
@@ -45,9 +39,6 @@ data MVector s a = MVector { _offset :: {-# UNPACK #-} !Int
45
39
--^ Underlying array
46
40
}
47
41
48
-
typeIOVector=MVectorRealWorld
49
-
typeSTVectors=MVectors
50
-
51
42
52
43
-- NOTE: This seems unsafe, see http://trac.haskell.org/vector/ticket/54
53
44
{-
@@ -165,23 +156,3 @@ loopM !n k = let
165
156
166
157
uninitialised::a
167
158
uninitialised =error"Data.Vector.Mutable: uninitialised element. If you are trying to compact a vector, use the 'Data.Vector.force' function to remove uninitialised elements from the underlying array."
168
-
169
-
170
-
-- Conversions - Arrays
171
-
-- -----------------------------
172
-
173
-
--| /O(n)/ Make a copy of a mutable array to a new mutable vector.
174
-
--
175
-
-- @since 0.12.2.0
176
-
fromMutableArray::PrimMonadm=>MutableArray (PrimStatem) a->m (MVector (PrimStatem) a)
0 commit comments