55{-# LANGUAGE RoleAnnotations #-}
66{-# LANGUAGE ScopedTypeVariables #-}
77{-# LANGUAGE TypeFamilies #-}
8+ {-# LANGUAGE PatternSynonyms #-}
89-- |
910-- Module : Data.Vector.Primitive
1011-- Copyright : (c) Roman Leshchinskiy 2008-2010
2425
2526module Data.Vector.Primitive (
2627 -- * Primitive vectors
27- Vector ( .. ) , MVector ( .. ) ,
28+ Vector , MVector , pattern MVector , pattern Vector ,
2829
2930 -- * Accessors
3031
@@ -163,9 +164,12 @@ module Data.Vector.Primitive (
163164
164165import Control.Applicative (Applicative )
165166import 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 )
168171import Data.Primitive ( Prim )
172+ import Data.Primitive.ByteArray
169173
170174import Control.Monad.ST ( ST )
171175import Control.Monad.Primitive
@@ -174,6 +178,10 @@ import Prelude
174178 ( Eq , Ord , Num , Enum , Monoid , Traversable , Monad , Bool , Ordering (.. ), Int , Maybe , Either
175179 , (==) )
176180
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" #-}
177185
178186-- Length
179187-- ------
0 commit comments