File tree Expand file tree Collapse file tree 6 files changed +19
-1
lines changed Expand file tree Collapse file tree 6 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -703,7 +703,7 @@ create :: (forall s. ST s (MVector s a)) -> Vector a
703
703
create p = G. create p
704
704
705
705
-- | Execute the monadic action and freeze the resulting vectors.
706
- createT :: Traversable f => (forall s . ST s (f (MVector s a ))) -> f (Vector a )
706
+ createT :: Traversable. Traversable f => (forall s . ST s (f (MVector s a ))) -> f (Vector a )
707
707
{-# INLINE createT #-}
708
708
createT p = G. createT p
709
709
Original file line number Diff line number Diff line change @@ -217,6 +217,10 @@ mkNoRepType :: String -> DataType
217
217
mkNoRepType = mkNorepType
218
218
#endif
219
219
220
+ #if !MIN_VERSION_base(4,8,0)
221
+ import Data.Traversable (Traversable , traverse )
222
+ #endif
223
+
220
224
-- Length information
221
225
-- ------------------
222
226
Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ import Data.Semigroup ( Semigroup(..) )
169
169
170
170
#if !MIN_VERSION_base(4,8,0)
171
171
import Data.Monoid ( Monoid (.. ) )
172
+ import Data.Traversable ( Traversable )
172
173
#endif
173
174
174
175
#if __GLASGOW_HASKELL__ >= 708
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ import Data.Semigroup ( Semigroup(..) )
174
174
175
175
#if !MIN_VERSION_base(4,8,0)
176
176
import Data.Monoid ( Monoid (.. ) )
177
+ import Data.Traversable ( Traversable )
177
178
#endif
178
179
179
180
#if __GLASGOW_HASKELL__ >= 708
Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ import Data.Semigroup ( Semigroup(..) )
191
191
192
192
#if !MIN_VERSION_base(4,8,0)
193
193
import Data.Monoid ( Monoid (.. ) )
194
+ import Data.Traversable ( Traversable )
194
195
#endif
195
196
196
197
#if __GLASGOW_HASKELL__ >= 708
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ module Tests.Vector (tests) where
3
3
import Boilerplater
4
4
import Utilities as Util
5
5
6
+ import Data.Traversable (Traversable (.. ))
7
+ import Data.Foldable (Foldable (foldMap ))
8
+
6
9
import qualified Data.Vector.Generic as V
7
10
import qualified Data.Vector
8
11
import qualified Data.Vector.Primitive
@@ -66,6 +69,14 @@ import Control.Monad.Trans.Writer
66
69
67
70
-- TODO: test non-IVector stuff?
68
71
72
+ #if !MIN_VERSION_base(4,7,0)
73
+ instance Foldable ((,) a ) where
74
+ foldMap f (_, b) = f b
75
+
76
+ instance Traversable ((,) a ) where
77
+ traverse f (a, b) = fmap ((,) a) $ f b
78
+ #endif
79
+
69
80
testSanity :: forall a v . (COMMON_CONTEXT (a , v )) => v a -> [Test ]
70
81
testSanity _ = [
71
82
testProperty " fromList.toList == id" prop_fromList_toList,
You can’t perform that action at this time.
0 commit comments