5
5
{-# LANGUAGE RoleAnnotations #-}
6
6
{-# LANGUAGE ScopedTypeVariables #-}
7
7
{-# LANGUAGE TypeFamilies #-}
8
+ {-# LANGUAGE PatternSynonyms #-}
8
9
-- |
9
10
-- Module : Data.Vector.Primitive
10
11
-- Copyright : (c) Roman Leshchinskiy 2008-2010
24
25
25
26
module Data.Vector.Primitive (
26
27
-- * Primitive vectors
27
- Vector ( .. ) , MVector ( .. ) ,
28
+ Vector , MVector , pattern MVector , pattern Vector ,
28
29
29
30
-- * Accessors
30
31
@@ -163,9 +164,12 @@ module Data.Vector.Primitive (
163
164
164
165
import Control.Applicative (Applicative )
165
166
import qualified Data.Vector.Generic as G
166
- import Data.Vector.Primitive.Unsafe (Vector (.. ),unsafeCoerceVector ,unsafeCast )
167
- import Data.Vector.Primitive.Mutable.Unsafe (MVector (.. ))
167
+ import Data.Vector.Primitive.Unsafe (Vector ,unsafeCoerceVector ,unsafeCast )
168
+ import qualified Data.Vector.Primitive.Unsafe as U
169
+ import Data.Vector.Primitive.Mutable.Unsafe (MVector )
170
+ import Data.Vector.Primitive.Mutable (pattern MVector )
168
171
import Data.Primitive ( Prim )
172
+ import Data.Primitive.ByteArray
169
173
170
174
import Control.Monad.ST ( ST )
171
175
import Control.Monad.Primitive
@@ -174,6 +178,10 @@ import Prelude
174
178
( Eq , Ord , Num , Enum , Monoid , Traversable , Monad , Bool , Ordering (.. ), Int , Maybe , Either
175
179
, (==) )
176
180
181
+ pattern Vector :: Int -> Int -> ByteArray -> Vector a
182
+ pattern Vector i j arr = U. Vector i j arr
183
+ {-# COMPLETE Vector #-}
184
+ {-# DEPRECATED Vector "Use constructor exported from Data.Vector.Primitive.Unsafe" #-}
177
185
178
186
-- Length
179
187
-- ------
0 commit comments