We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 709b255 commit a235b86Copy full SHA for a235b86
src/Data/Array.purs
@@ -115,10 +115,8 @@ foreign import replicate :: forall a. Int -> a -> Array a
115
116
-- | Perform a monadic action `n` times collecting all of the results.
117
replicateM :: forall m a. (Monad m) => Int -> m a -> m (Array a)
118
-replicateM n m | n < 1 = return []
119
- | otherwise = do a <- m
120
- as <- replicateM (n - 1) m
121
- return (a : as)
+replicateM n m | n < 1 = return []
+ | otherwise = sequence $ replicate n m
122
123
-- | Attempt a computation multiple times, requiring at least one success.
124
-- |
0 commit comments