@@ -85,6 +85,9 @@ import Data.Vector.Primitive (Prim)
85
85
import qualified Data.Vector.Storable as Storable
86
86
import qualified Data.Vector.Unboxed as Unboxed
87
87
import Data.Vector.Unboxed (Unbox )
88
+ #if MIN_VERSION_vector(0,13,2)
89
+ import qualified Data.Vector.Strict as VectorStrict
90
+ #endif
88
91
import Data.Word
89
92
import Foreign.Storable (Storable )
90
93
@@ -113,6 +116,9 @@ type instance Index (Vector.Vector a) = Int
113
116
type instance Index (Prim. Vector a ) = Int
114
117
type instance Index (Storable. Vector a ) = Int
115
118
type instance Index (Unboxed. Vector a ) = Int
119
+ #if MIN_VERSION_vector(0,13,2)
120
+ type instance Index (VectorStrict. Vector a ) = Int
121
+ #endif
116
122
type instance Index (Complex a ) = Int
117
123
type instance Index (Identity a ) = ()
118
124
type instance Index (Maybe a ) = ()
@@ -396,6 +402,15 @@ instance Unbox a => Ixed (Unboxed.Vector a) where
396
402
| otherwise = pure v
397
403
{-# INLINE ix #-}
398
404
405
+ #if MIN_VERSION_vector(0,13,2)
406
+ type instance IxValue (VectorStrict. Vector a ) = a
407
+ instance Ixed (VectorStrict. Vector a ) where
408
+ ix i f v
409
+ | 0 <= i && i < VectorStrict. length v = f (v VectorStrict. ! i) <&> \ a -> v VectorStrict. // [(i, a)]
410
+ | otherwise = pure v
411
+ {-# INLINE ix #-}
412
+ #endif
413
+
399
414
type instance IxValue StrictT. Text = Char
400
415
instance Ixed StrictT. Text where
401
416
ix e f s
0 commit comments