3
3
{-# LANGUAGE MultiParamTypeClasses #-}
4
4
{-# LANGUAGE RoleAnnotations #-}
5
5
{-# LANGUAGE ScopedTypeVariables #-}
6
+ {-# LANGUAGE PatternSynonyms #-}
6
7
-- |
7
8
-- Module : Data.Vector.Primitive.Mutable
8
9
-- Copyright : (c) Roman Leshchinskiy 2008-2010
19
20
20
21
module Data.Vector.Primitive.Mutable (
21
22
-- * Mutable vectors of primitive types
22
- MVector (.. ), IOVector , STVector ,
23
+ MVector , IOVector , STVector ,
24
+ pattern MVector ,
23
25
24
26
-- * Accessors
25
27
@@ -70,6 +72,7 @@ module Data.Vector.Primitive.Mutable (
70
72
71
73
import qualified Data.Vector.Generic.Mutable as G
72
74
import Data.Primitive ( Prim , sizeOf )
75
+ import Data.Primitive.ByteArray
73
76
import Data.Vector.Internal.Check
74
77
import Data.Vector.Primitive.Unsafe (MVector ,IOVector ,STVector ,unsafeCoerceMVector ,unsafeCast )
75
78
import qualified Data.Vector.Primitive.Unsafe as U
@@ -87,6 +90,11 @@ import Prelude
87
90
#include "vector.h"
88
91
89
92
93
+ pattern MVector :: Int -> Int -> MutableByteArray s -> MVector s a
94
+ pattern MVector i j arr = U. MVector i j arr
95
+ {-# COMPLETE MVector #-}
96
+ {-# DEPRECATED MVector "Use constructor exported from Data.Vector.Primitive.Unsafe" #-}
97
+
90
98
-- Length information
91
99
-- ------------------
92
100
0 commit comments