Skip to content

Commit e2a43cf

Browse files
committed
Use mapM in createT because ST wasn't Applicative in 7.0
1 parent 28489fd commit e2a43cf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Data/Vector/Generic.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ mkNoRepType :: String -> DataType
217217
mkNoRepType = mkNorepType
218218
#endif
219219

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))
223221

224222
-- Length information
225223
-- ------------------
@@ -723,9 +721,11 @@ create :: Vector v a => (forall s. ST s (Mutable v s a)) -> v a
723721
create p = new (New.create p)
724722

725723
-- | 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)
727727
{-# INLINE createT #-}
728-
createT p = runST (p >>= traverse unsafeFreeze)
728+
createT p = runST (p >>= T.mapM unsafeFreeze)
729729

730730
-- Restricting memory usage
731731
-- ------------------------

0 commit comments

Comments
 (0)