@@ -1630,7 +1630,7 @@ foldr f z arr = D.foldr f z $ toStreamD arr
1631-- XXX Keep the bound intact to not lose any free space? Perf impact?
1631-- XXX Keep the bound intact to not lose any free space? Perf impact?
1633−-- | @writeAppendNUnsafe alloc n@ appends up to @n@ input items to the supplied
1633+-- | @writeAppendNUnsafe n alloc@ appends up to @n@ input items to the supplied
1634-- array.
1634-- array.
1636-- Unsafe: Do not drive the fold beyond @n@ elements, it will lead to memory
1636-- Unsafe: Do not drive the fold beyond @n@ elements, it will lead to memory
@@ -1641,10 +1641,10 @@ foldr f z arr = D.foldr f z $ toStreamD arr
1641-- /Internal/
1641-- /Internal/
1642{-# INLINE_NORMAL writeAppendNUnsafe #-}
1642{-# INLINE_NORMAL writeAppendNUnsafe #-}
1643writeAppendNUnsafe :: forall m a. (MonadIO m, Unbox a) =>
1643writeAppendNUnsafe :: forall m a. (MonadIO m, Unbox a) =>
1644− m (Array a)
1645+ -> m (Array a)
1646 -> Fold m a (Array a)
1646 -> Fold m a (Array a)
1647−writeAppendNUnsafe action n =
1647+writeAppendNUnsafe n action =
1648 fmap fromArrayUnsafe $ FL.foldlM' step initial
1648 fmap fromArrayUnsafe $ FL.foldlM' step initial
@@ -1669,12 +1669,12 @@ writeAppendNUnsafe action n =
1669-- | Append @n@ elements to an existing array. Any free space left in the array
1669-- | Append @n@ elements to an existing array. Any free space left in the array
1670-- after appending @n@ elements is lost.
1670-- after appending @n@ elements is lost.
1672−-- >>> writeAppendN initial n = Fold.take n (Array.writeAppendNUnsafe initial n)
1672+-- >>> writeAppendN n initial = Fold.take n (Array.writeAppendNUnsafe n initial)
1674{-# INLINE_NORMAL writeAppendN #-}
1674{-# INLINE_NORMAL writeAppendN #-}
1675writeAppendN :: forall m a. (MonadIO m, Unbox a) =>
1675writeAppendN :: forall m a. (MonadIO m, Unbox a) =>
1676− m (Array a) -> Int -> Fold m a (Array a)
1676+ Int -> m (Array a) -> Fold m a (Array a)
1677−writeAppendN initial n = FL.take n (writeAppendNUnsafe initial n)
1677+writeAppendN n initial = FL.take n (writeAppendNUnsafe n initial)
1679-- | @writeAppendWith realloc action@ mutates the array generated by @action@ to
1679-- | @writeAppendWith realloc action@ mutates the array generated by @action@ to
1680-- append the input stream. If there is no reserved space available in the
1680-- append the input stream. If there is no reserved space available in the
@@ -1756,7 +1756,7 @@ writeNWith alloc n = FL.take n (writeNWithUnsafe alloc n)
1757-- >>> writeN = Array.writeNWith Array.newPinned
1757-- >>> writeN = Array.writeNWith Array.newPinned
1758-- >>> writeN n = Fold.take n (Array.writeNUnsafe n)
1758-- >>> writeN n = Fold.take n (Array.writeNUnsafe n)
1759−-- >>> writeN n = Array.writeAppendN (Array.newPinned n) n
1759+-- >>> writeN n = Array.writeAppendN n (Array.newPinned n)
1761{-# INLINE_NORMAL writeN #-}
1761{-# INLINE_NORMAL writeN #-}
1762writeN :: forall m a. (MonadIO m, Unbox a) => Int -> Fold m a (Array a)
1762writeN :: forall m a. (MonadIO m, Unbox a) => Int -> Fold m a (Array a)
@@ -1802,7 +1802,7 @@ writeRevN = writeRevNWith newPinned
1802-- stream to an 'Array' aligned to the given size.
1802-- stream to an 'Array' aligned to the given size.
1804-- >>> writeNAligned align = Array.writeNWith (Array.newAlignedPinned align)
1804-- >>> writeNAligned align = Array.writeNWith (Array.newAlignedPinned align)
1805−-- >>> writeNAligned align n = Array.writeAppendN (Array.newAlignedPinned align n) n
1805+-- >>> writeNAligned align n = Array.writeAppendN n (Array.newAlignedPinned align n)
1807-- /Pre-release/
1807-- /Pre-release/