on master help sign in
Streamly: Internal: FileSystem: Cleanup hlint warnings

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>

commit4635e20567bff6809fa3c702dc24d100ad6b3b89 authorSanchayan Maity <maitysanchayan@gmail.com> dateTue 24 Mar 2020, 20:08 (7 years ago) parent11b5095
3 files changed+6−17
src/Streamly/Internal/FileSystem/Dir.hs−4 src/Streamly/Internal/FileSystem/File.hs+5−9 src/Streamly/Internal/FileSystem/Handle.hs+1−4
src/Streamly/Internal/FileSystem/Dir.hs−4
@@ -1,8 +1,4 @@
11{-# LANGUAGE CPP #-}
2−{-# LANGUAGE BangPatterns #-}
3−{-# LANGUAGE MagicHash #-}
4−{-# LANGUAGE RecordWildCards #-}
5−{-# LANGUAGE UnboxedTuples #-}
62
73#include "inline.hs"
84
src/Streamly/Internal/FileSystem/File.hs+5−9
@@ -1,9 +1,5 @@
11{-# LANGUAGE CPP #-}
2−{-# LANGUAGE BangPatterns #-}
32{-# LANGUAGE FlexibleContexts #-}
4−{-# LANGUAGE MagicHash #-}
5−{-# LANGUAGE RecordWildCards #-}
6−{-# LANGUAGE UnboxedTuples #-}
73
84#include "inline.hs"
95
@@ -180,14 +176,14 @@ usingFile =
180176-- @since 0.7.0
181177{-# INLINABLE writeArray #-}
182178writeArray :: Storable a => FilePath -> Array a -> IO ()
183−writeArray file arr = SIO.withFile file WriteMode (\h -> FH.writeArray h arr)
179+writeArray file arr = SIO.withFile file WriteMode (`FH.writeArray` arr)
184180
185181-- | append an array to a file.
186182--
187183-- @since 0.7.0
188184{-# INLINABLE appendArray #-}
189185appendArray :: Storable a => FilePath -> Array a -> IO ()
190−appendArray file arr = SIO.withFile file AppendMode (\h -> FH.writeArray h arr)
186+appendArray file arr = SIO.withFile file AppendMode (`FH.writeArray` arr)
191187
192188-------------------------------------------------------------------------------
193189-- Stream of Arrays IO
@@ -353,12 +349,12 @@ writeChunks path = Fold step initial extract
353349 initial = do
354350 h <- liftIO (openFile path WriteMode)
355351 fld <- FL.initialize (FH.writeChunks h)
356− `MC.onException` (liftIO $ hClose h)
352+ `MC.onException` liftIO (hClose h)
357353 return (fld, h)
358354 step (fld, h) x = do
359− r <- FL.runStep fld x `MC.onException` (liftIO $ hClose h)
355+ r <- FL.runStep fld x `MC.onException` liftIO (hClose h)
360356 return (r, h)
361− extract ((Fold _ initial1 extract1), h) = do
357+ extract (Fold _ initial1 extract1, h) = do
362358 liftIO $ hClose h
363359 initial1 >>= extract1
364360
src/Streamly/Internal/FileSystem/Handle.hs+1−4
@@ -1,9 +1,6 @@
11{-# LANGUAGE CPP #-}
2−{-# LANGUAGE BangPatterns #-}
32{-# LANGUAGE FlexibleContexts #-}
4−{-# LANGUAGE MagicHash #-}
53{-# LANGUAGE RecordWildCards #-}
6−{-# LANGUAGE UnboxedTuples #-}
74
85#include "inline.hs"
96
@@ -352,7 +349,7 @@ writeArray h Array{..} = withForeignPtr aStart $ \p -> hPutBuf h p aLen
352349{-# INLINE fromChunks #-}
353350fromChunks :: (MonadIO m, Storable a)
354351 => Handle -> SerialT m (Array a) -> m ()
355−fromChunks h m = S.mapM_ (liftIO . writeArray h) m
352+fromChunks h = S.mapM_ (liftIO . writeArray h)
356353
357354-- | Write a stream of chunks to standard output.
358355--