File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -217,9 +217,7 @@ 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
220
+ import qualified Data.Traversable as T (Traversable (mapM ))
223
221
224
222
-- Length information
225
223
-- ------------------
@@ -723,9 +721,11 @@ create :: Vector v a => (forall s. ST s (Mutable v s a)) -> v a
723
721
create p = new (New. create p)
724
722
725
723
-- | Execute the monadic action and freeze the resulting vectors.
726
- createT :: (Traversable f , Vector v a ) => (forall s . ST s (f (Mutable v s a ))) -> f (v a )
724
+ createT
725
+ :: (T. Traversable f , Vector v a )
726
+ => (forall s . ST s (f (Mutable v s a ))) -> f (v a )
727
727
{-# INLINE createT #-}
728
- createT p = runST (p >>= traverse unsafeFreeze)
728
+ createT p = runST (p >>= T. mapM unsafeFreeze)
729
729
730
730
-- Restricting memory usage
731
731
-- ------------------------
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module Tests.Vector (tests) where
3
3
import Boilerplater
4
4
import Utilities as Util
5
5
6
- import Data.Traversable (Traversable (.. ))
6
+ import qualified Data.Traversable as T (Traversable (.. ))
7
7
import Data.Foldable (Foldable (foldMap ))
8
8
9
9
import qualified Data.Vector.Generic as V
@@ -73,7 +73,7 @@ import Control.Monad.Trans.Writer
73
73
instance Foldable ((,) a ) where
74
74
foldMap f (_, b) = f b
75
75
76
- instance Traversable ((,) a ) where
76
+ instance T. Traversable ((,) a ) where
77
77
traverse f (a, b) = fmap ((,) a) $ f b
78
78
#endif
79
79
@@ -233,7 +233,7 @@ testPolymorphicFunctions _ = $(testProperties [
233
233
= (\ n _ _ -> n < 1000 ) ===> V. iterateN `eq` (\ n f -> take n . iterate f)
234
234
235
235
prop_createT :: P ((a , v a ) -> (a , v a ))
236
- prop_createT = (\ v -> V. createT (traverse V. thaw v)) `eq` id
236
+ prop_createT = (\ v -> V. createT (T. mapM V. thaw v)) `eq` id
237
237
238
238
prop_head :: P (v a -> a ) = not . V. null ===> V. head `eq` head
239
239
prop_last :: P (v a -> a ) = not . V. null ===> V. last `eq` last
You can’t perform that action at this time.
0 commit comments