@@ -1163,10 +1163,22 @@ getSlice index len (Array contents start e _) =
1163-- to another array. However, in-place reverse can be useful to take adavantage
1163-- to another array. However, in-place reverse can be useful to take adavantage
1164-- of cache locality and when you do not want to allocate additional memory.
1164-- of cache locality and when you do not want to allocate additional memory.
1166−-- /Unimplemented/
1166+-- /Pre-release/
1167{-# INLINE reverse #-}
1167{-# INLINE reverse #-}
1168−reverse :: Array a -> m Bool
1168+reverse :: forall m a. (MonadIO m, Storable a) => Array a -> m ()
1169+reverse Array{..} = liftIO $ do
1171+ h = aEnd `plusPtr` (- elemSize)
1169−reverse = undefined
1176+ elemSize = sizeOf (undefined :: a)
1181+ swap (l `plusPtr` elemSize) (h `plusPtr` (- elemSize))
1171-- | Generate the next permutation of the sequence, returns False if this is
1183-- | Generate the next permutation of the sequence, returns False if this is
1172-- the last permutation.
1184-- the last permutation.