Skip to content

Commit f41d88a

Browse files
committed
Replace exported constructor with deprecated pattern
1 parent 9d23730 commit f41d88a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

vector/src/Data/Vector/Primitive/Mutable.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
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
@@ -19,7 +20,8 @@
1920

2021
module 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

7173
import qualified Data.Vector.Generic.Mutable as G
7274
import Data.Primitive ( Prim, sizeOf )
75+
import Data.Primitive.ByteArray
7376
import Data.Vector.Internal.Check
7477
import Data.Vector.Primitive.Unsafe (MVector,IOVector,STVector,unsafeCoerceMVector,unsafeCast)
7578
import 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

Comments
 (0)