33{-# LANGUAGE MultiParamTypeClasses #-}
44{-# LANGUAGE RoleAnnotations #-}
55{-# LANGUAGE ScopedTypeVariables #-}
6+ {-# LANGUAGE PatternSynonyms #-}
67-- |
78-- Module : Data.Vector.Primitive.Mutable
89-- Copyright : (c) Roman Leshchinskiy 2008-2010
1920
2021module Data.Vector.Primitive.Mutable (
2122 -- * Mutable vectors of primitive types
22- MVector (.. ), IOVector , STVector ,
23+ MVector , IOVector , STVector ,
24+ pattern MVector ,
2325
2426 -- * Accessors
2527
@@ -70,6 +72,7 @@ module Data.Vector.Primitive.Mutable (
7072
7173import qualified Data.Vector.Generic.Mutable as G
7274import Data.Primitive ( Prim , sizeOf )
75+ import Data.Primitive.ByteArray
7376import Data.Vector.Internal.Check
7477import Data.Vector.Primitive.Unsafe (MVector ,IOVector ,STVector ,unsafeCoerceMVector ,unsafeCast )
7578import qualified Data.Vector.Primitive.Unsafe as U
@@ -87,6 +90,11 @@ import Prelude
8790#include "vector.h"
8891
8992
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+
9098-- Length information
9199-- ------------------
92100
0 commit comments