From 03a5699ae1bfc520cd8204912bda4985023f0ac1 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Sun, 17 Nov 2024 10:08:55 +0530 Subject: [PATCH 1/2] Enable listDirChunked for Windows --- examples/ListDir.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/ListDir.hs b/examples/ListDir.hs index b4d1cad..8fa5b58 100644 --- a/examples/ListDir.hs +++ b/examples/ListDir.hs @@ -42,13 +42,13 @@ import qualified Streamly.Data.Unfold as Unfold import qualified Streamly.Internal.Data.Unfold as Unfold (either, nil) import qualified Streamly.Internal.FileSystem.DirIO as Dir - (readEitherPaths, eitherReaderPaths) + (readEitherChunks, readEitherPaths, eitherReaderPaths) import qualified Streamly.FileSystem.Handle as Handle import qualified Streamly.FileSystem.Path as Path import qualified Streamly.Internal.FileSystem.Path as Path (toChunk) #if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) import qualified Streamly.Internal.FileSystem.Posix.ReadDir as Dir - (readEitherChunks, readEitherByteChunks) + (readEitherByteChunks) #endif #if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) @@ -95,6 +95,7 @@ listDirByteChunked = do streamDirMaybe :: Either [Path] b -> Maybe (Stream IO (Either [Path] (Array Word8))) streamDirMaybe = either (Just . Dir.readEitherByteChunks) (const Nothing) +#endif -- Faster than the listDir implementation below listDirChunked :: IO () @@ -138,7 +139,6 @@ listDirChunked = do streamDirMaybe :: Either [Path] b -> Maybe (Stream IO (Either [Path] [Path])) streamDirMaybe = either (Just . Dir.readEitherChunks) (const Nothing) -#endif listDir :: IO () listDir = do @@ -194,7 +194,7 @@ main :: IO () main = do hSetBuffering stdout LineBuffering listDir -#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) -- listDirChunked +#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) -- listDirByteChunked #endif From 43230b0cd5e45730d38d06ccf7ea2daa08fdcaa3 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Mon, 18 Nov 2024 01:12:20 +0530 Subject: [PATCH 2/2] Disable (temporarily) deprecation warnings --- streamly-examples.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/streamly-examples.cabal b/streamly-examples.cabal index 34e035c..d584f41 100644 --- a/streamly-examples.cabal +++ b/streamly-examples.cabal @@ -93,6 +93,7 @@ common exe-options -Wincomplete-uni-patterns -Wredundant-constraints -Wnoncanonical-monad-instances + -Wno-deprecations if impl(ghc >= 9.8) ghc-options: -Wno-x-partial