@@ -88,7 +88,6 @@ where
88import Control.Monad.Catch (MonadCatch)
88import Control.Monad.Catch (MonadCatch)
89import Control.Monad.IO.Class (MonadIO(..))
89import Control.Monad.IO.Class (MonadIO(..))
90import Data.Word (Word8)
90import Data.Word (Word8)
91−import Foreign.Storable (Storable(..))
92import System.IO (Handle, openFile, IOMode(..), hClose)
91import System.IO (Handle, openFile, IOMode(..), hClose)
93import Prelude hiding (read)
92import Prelude hiding (read)
@@ -198,14 +197,14 @@ usingFile3 = UF.bracket before after
199-- @since 0.7.0
198-- @since 0.7.0
200{-# INLINABLE putChunk #-}
199{-# INLINABLE putChunk #-}
201−putChunk :: Storable a => FilePath -> Array a -> IO ()
200+putChunk :: FilePath -> Array a -> IO ()
202putChunk file arr = SIO.withFile file WriteMode (`FH.putChunk` arr)
201putChunk file arr = SIO.withFile file WriteMode (`FH.putChunk` arr)
204-- | append an array to a file.
203-- | append an array to a file.
206-- @since 0.7.0
205-- @since 0.7.0
207{-# INLINABLE appendArray #-}
206{-# INLINABLE appendArray #-}
208−appendArray :: Storable a => FilePath -> Array a -> IO ()
207+appendArray :: FilePath -> Array a -> IO ()
209appendArray file arr = SIO.withFile file AppendMode (`FH.putChunk` arr)
208appendArray file arr = SIO.withFile file AppendMode (`FH.putChunk` arr)
211-------------------------------------------------------------------------------
210-------------------------------------------------------------------------------
@@ -322,7 +321,7 @@ readShared = undefined
322-------------------------------------------------------------------------------
321-------------------------------------------------------------------------------
324{-# INLINE fromChunksMode #-}
323{-# INLINE fromChunksMode #-}
325−fromChunksMode :: (MonadAsync m, MonadCatch m, Storable a)
324+fromChunksMode :: (MonadAsync m, MonadCatch m)
326 => IOMode -> FilePath -> SerialT m (Array a) -> m ()
325 => IOMode -> FilePath -> SerialT m (Array a) -> m ()
327fromChunksMode mode file xs = S.drain $
326fromChunksMode mode file xs = S.drain $
328 withFile file mode (\h -> S.mapM (FH.putChunk h) xs)
327 withFile file mode (\h -> S.mapM (FH.putChunk h) xs)
@@ -331,7 +330,7 @@ fromChunksMode mode file xs = S.drain $
332-- @since 0.7.0
331-- @since 0.7.0
333{-# INLINE fromChunks #-}
332{-# INLINE fromChunks #-}
334−fromChunks :: (MonadAsync m, MonadCatch m, Storable a)
333+fromChunks :: (MonadAsync m, MonadCatch m)
335 => FilePath -> SerialT m (Array a) -> m ()
334 => FilePath -> SerialT m (Array a) -> m ()
336fromChunks = fromChunksMode WriteMode
335fromChunks = fromChunksMode WriteMode
@@ -376,7 +375,7 @@ write = toHandleWith A.defaultChunkSize
377-- /Pre-release/
376-- /Pre-release/
378{-# INLINE writeChunks #-}
377{-# INLINE writeChunks #-}
379−writeChunks :: (MonadIO m, MonadCatch m, Storable a)
378+writeChunks :: (MonadIO m, MonadCatch m)
380 => FilePath -> Fold m (Array a) ()
379 => FilePath -> Fold m (Array a) ()
381writeChunks path = Fold step initial extract
380writeChunks path = Fold step initial extract
@@ -422,7 +421,7 @@ write = writeWithBufferOf defaultChunkSize
423-- @since 0.7.0
422-- @since 0.7.0
424{-# INLINE appendChunks #-}
423{-# INLINE appendChunks #-}
425−appendChunks :: (MonadAsync m, MonadCatch m, Storable a)
424+appendChunks :: (MonadAsync m, MonadCatch m)
426 => FilePath -> SerialT m (Array a) -> m ()
425 => FilePath -> SerialT m (Array a) -> m ()
427appendChunks = fromChunksMode AppendMode
426appendChunks = fromChunksMode AppendMode