@@ -635,10 +635,20 @@ modifyIndices = undefined
636-- | Modify each element of an array using the supplied modifier function.
636-- | Modify each element of an array using the supplied modifier function.
638−-- /Unimplemented/
638+-- /Pre-release/
639−modify :: -- forall m a b. (MonadIO m, Storable a) =>
639+modify :: forall m a. (MonadIO m, Storable a)
640− Array a -> (a -> a) -> m ()
640+ => Array a -> (a -> a) -> m ()
641+modify Array{..} f = liftIO $
642+ unsafeWithArrayContents arrContents arrStart go
641−modify = undefined
647+ let elemSize = sizeOf (undefined :: a)
648+ when (ptr `plusPtr` elemSize <= aEnd) $ do
651+ go (ptr `plusPtr` elemSize)
643-- | Swap the elements at two indices.
653-- | Swap the elements at two indices.